Health don't updating after onResume
This commit is contained in:
parent
2501b899fd
commit
20e37b935b
4 changed files with 88 additions and 85 deletions
|
@ -1,4 +1,4 @@
|
||||||
package com.ddns.kauron.dungeonmanager;
|
package com.kauron.dungeonmanager;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.test.ApplicationTestCase;
|
import android.test.ApplicationTestCase;
|
|
@ -40,20 +40,20 @@ public class HealthDialogFragment extends DialogFragment {
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
builder.setMessage(com.ddns.kauron.dungeonmanager.R.string.new_energies_message)
|
builder.setMessage(com.kauron.dungeonmanager.R.string.new_energies_message)
|
||||||
.setTitle(com.ddns.kauron.dungeonmanager.R.string.new_energies)
|
.setTitle(com.kauron.dungeonmanager.R.string.new_energies)
|
||||||
.setPositiveButton(com.ddns.kauron.dungeonmanager.R.string.me, new DialogInterface.OnClickListener() {
|
.setPositiveButton(com.kauron.dungeonmanager.R.string.me, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
mListener.heal(HealthDialogFragment.this, true);
|
mListener.heal(HealthDialogFragment.this, true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(com.ddns.kauron.dungeonmanager.R.string.other, new DialogInterface.OnClickListener() {
|
.setNegativeButton(com.kauron.dungeonmanager.R.string.other, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
mListener.heal(HealthDialogFragment.this, false);
|
mListener.heal(HealthDialogFragment.this, false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNeutralButton(com.ddns.kauron.dungeonmanager.R.string.cancel, new DialogInterface.OnClickListener() {
|
.setNeutralButton(com.kauron.dungeonmanager.R.string.cancel, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
|
|
|
@ -21,18 +21,18 @@ public class Introduction extends ActionBarActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
setContentView(com.ddns.kauron.dungeonmanager.R.layout.activity_introduction);
|
setContentView(com.kauron.dungeonmanager.R.layout.activity_introduction);
|
||||||
name = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.editNameIntro);
|
name = (EditText) findViewById(com.kauron.dungeonmanager.R.id.editNameIntro);
|
||||||
level = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.editLevelIntro);
|
level = (EditText) findViewById(com.kauron.dungeonmanager.R.id.editLevelIntro);
|
||||||
|
|
||||||
fue = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.FUE);
|
fue = (EditText) findViewById(com.kauron.dungeonmanager.R.id.FUE);
|
||||||
con = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.CON);
|
con = (EditText) findViewById(com.kauron.dungeonmanager.R.id.CON);
|
||||||
des = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.DES);
|
des = (EditText) findViewById(com.kauron.dungeonmanager.R.id.DES);
|
||||||
sab = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.SAB);
|
sab = (EditText) findViewById(com.kauron.dungeonmanager.R.id.SAB);
|
||||||
intel = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.INT);
|
intel = (EditText) findViewById(com.kauron.dungeonmanager.R.id.INT);
|
||||||
car = (EditText) findViewById(com.ddns.kauron.dungeonmanager.R.id.CAR);
|
car = (EditText) findViewById(com.kauron.dungeonmanager.R.id.CAR);
|
||||||
|
|
||||||
classSpinner = (Spinner) findViewById(com.ddns.kauron.dungeonmanager.R.id.classSpinner);
|
classSpinner = (Spinner) findViewById(com.kauron.dungeonmanager.R.id.classSpinner);
|
||||||
classSpinner.setAdapter(
|
classSpinner.setAdapter(
|
||||||
new ArrayAdapter<>(
|
new ArrayAdapter<>(
|
||||||
this,
|
this,
|
||||||
|
@ -41,7 +41,7 @@ public class Introduction extends ActionBarActivity {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
raceSpinner = (Spinner) findViewById(com.ddns.kauron.dungeonmanager.R.id.raceSpinner);
|
raceSpinner = (Spinner) findViewById(com.kauron.dungeonmanager.R.id.raceSpinner);
|
||||||
raceSpinner.setAdapter(
|
raceSpinner.setAdapter(
|
||||||
new ArrayAdapter<>(
|
new ArrayAdapter<>(
|
||||||
this,
|
this,
|
||||||
|
@ -55,7 +55,7 @@ public class Introduction extends ActionBarActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(com.ddns.kauron.dungeonmanager.R.menu.menu_introduction, menu);
|
getMenuInflater().inflate(com.kauron.dungeonmanager.R.menu.menu_introduction, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,13 +67,13 @@ public class Introduction extends ActionBarActivity {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == com.ddns.kauron.dungeonmanager.R.id.action_finish) {
|
if (id == com.kauron.dungeonmanager.R.id.action_finish) {
|
||||||
if(finished()) {
|
if(finished()) {
|
||||||
this.finish();
|
this.finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.missing_info_error,
|
com.kauron.dungeonmanager.R.string.missing_info_error,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class MainActivity extends ActionBarActivity
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(com.ddns.kauron.dungeonmanager.R.layout.activity_main);
|
setContentView(com.kauron.dungeonmanager.R.layout.activity_main);
|
||||||
undo = false;
|
undo = false;
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,13 @@ public class MainActivity extends ActionBarActivity
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(com.ddns.kauron.dungeonmanager.R.menu.menu_main, menu);
|
getMenuInflater().inflate(com.kauron.dungeonmanager.R.menu.menu_main, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPrepareOptionsMenu (Menu menu) {
|
public boolean onPrepareOptionsMenu (Menu menu) {
|
||||||
menu.findItem(com.ddns.kauron.dungeonmanager.R.id.action_undo).setVisible(undo);
|
menu.findItem(com.kauron.dungeonmanager.R.id.action_undo).setVisible(undo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ public class MainActivity extends ActionBarActivity
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
//noinspection SimplifiableIfStatement
|
||||||
if (id == com.ddns.kauron.dungeonmanager.R.id.action_cure) {
|
if (id == com.kauron.dungeonmanager.R.id.action_cure) {
|
||||||
showHealthDialog();
|
showHealthDialog();
|
||||||
return true;
|
return true;
|
||||||
} else if (id == com.ddns.kauron.dungeonmanager.R.id.action_edit_basics) {
|
} else if (id == com.kauron.dungeonmanager.R.id.action_edit_basics) {
|
||||||
//TODO: try this startChildActivity()
|
//TODO: try this startChildActivity()
|
||||||
SharedPreferences p = getSharedPreferences("basics", MODE_PRIVATE);
|
SharedPreferences p = getSharedPreferences("basics", MODE_PRIVATE);
|
||||||
Intent intent = new Intent(this, Introduction.class);
|
Intent intent = new Intent(this, Introduction.class);
|
||||||
|
@ -72,19 +72,19 @@ public class MainActivity extends ActionBarActivity
|
||||||
));
|
));
|
||||||
restoreData();
|
restoreData();
|
||||||
return true;
|
return true;
|
||||||
} else if (id == com.ddns.kauron.dungeonmanager.R.id.action_undo) {
|
} else if (id == com.kauron.dungeonmanager.R.id.action_undo) {
|
||||||
undo();
|
undo();
|
||||||
return true;
|
return true;
|
||||||
} else if (id == com.ddns.kauron.dungeonmanager.R.id.action_reset) {
|
} else if (id == com.kauron.dungeonmanager.R.id.action_reset) {
|
||||||
|
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
||||||
alert.setTitle(getString(com.ddns.kauron.dungeonmanager.R.string.reset_confirmation_title));
|
alert.setTitle(getString(com.kauron.dungeonmanager.R.string.reset_confirmation_title));
|
||||||
alert.setMessage(getString(com.ddns.kauron.dungeonmanager.R.string.reset_confirmation));
|
alert.setMessage(getString(com.kauron.dungeonmanager.R.string.reset_confirmation));
|
||||||
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.message_reset,
|
com.kauron.dungeonmanager.R.string.message_reset,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
getSharedPreferences("basics", MODE_PRIVATE).edit().clear().apply();
|
getSharedPreferences("basics", MODE_PRIVATE).edit().clear().apply();
|
||||||
|
@ -146,14 +146,14 @@ public class MainActivity extends ActionBarActivity
|
||||||
if (hasCured == Player.NOT_CURED) {
|
if (hasCured == Player.NOT_CURED) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.no_curative_efforts_error,
|
com.kauron.dungeonmanager.R.string.no_curative_efforts_error,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
} else {
|
} else {
|
||||||
if(hasCured == Player.MAXED){
|
if(hasCured == Player.MAXED){
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.maxed_curative,
|
com.kauron.dungeonmanager.R.string.maxed_curative,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
|
@ -168,18 +168,18 @@ public class MainActivity extends ActionBarActivity
|
||||||
|
|
||||||
public void damage(final View view){
|
public void damage(final View view){
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
||||||
alert.setTitle(getString(com.ddns.kauron.dungeonmanager.R.string.suffer_damage));
|
alert.setTitle(getString(com.kauron.dungeonmanager.R.string.suffer_damage));
|
||||||
|
|
||||||
// Set an EditText view to get user input
|
// Set an EditText view to get user input
|
||||||
final EditText input = new EditText(this);
|
final EditText input = new EditText(this);
|
||||||
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
input.setHint(com.ddns.kauron.dungeonmanager.R.string.suffer_damage_hint);
|
input.setHint(com.kauron.dungeonmanager.R.string.suffer_damage_hint);
|
||||||
|
|
||||||
alert.setView(input);
|
alert.setView(input);
|
||||||
|
|
||||||
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
Button pg = (Button) findViewById(com.ddns.kauron.dungeonmanager.R.id.pgCurrent);
|
Button pg = (Button) findViewById(com.kauron.dungeonmanager.R.id.pgCurrent);
|
||||||
try {
|
try {
|
||||||
int preValue = Integer.parseInt(pg.getText().toString());
|
int preValue = Integer.parseInt(pg.getText().toString());
|
||||||
int damage = Integer.parseInt(input.getText().toString());
|
int damage = Integer.parseInt(input.getText().toString());
|
||||||
|
@ -212,26 +212,26 @@ public class MainActivity extends ActionBarActivity
|
||||||
private void healthStatusCheck() {
|
private void healthStatusCheck() {
|
||||||
int status = player.getState();
|
int status = player.getState();
|
||||||
int lastState = player.getLastState();
|
int lastState = player.getLastState();
|
||||||
Button pg = (Button) findViewById(com.ddns.kauron.dungeonmanager.R.id.pgCurrent);
|
Button pg = (Button) findViewById(com.kauron.dungeonmanager.R.id.pgCurrent);
|
||||||
pg.setText(String.valueOf(player.getPg()));
|
pg.setText(String.valueOf(player.getPg()));
|
||||||
if (status == Player.MUERTO) {
|
if (status == Player.MUERTO) {
|
||||||
pg.setTextColor(Color.BLACK);
|
pg.setTextColor(Color.BLACK);
|
||||||
pg.setBackgroundColor(Color.RED);
|
pg.setBackgroundColor(Color.RED);
|
||||||
|
|
||||||
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
||||||
alert.setTitle(getString(com.ddns.kauron.dungeonmanager.R.string.reset_confirmation_title));
|
alert.setTitle(getString(com.kauron.dungeonmanager.R.string.reset_confirmation_title));
|
||||||
alert.setMessage(getString(com.ddns.kauron.dungeonmanager.R.string.reset_confirmation));
|
alert.setMessage(getString(com.kauron.dungeonmanager.R.string.reset_confirmation));
|
||||||
alert.setPositiveButton(com.ddns.kauron.dungeonmanager.R.string.action_undo, new DialogInterface.OnClickListener() {
|
alert.setPositiveButton(com.kauron.dungeonmanager.R.string.action_undo, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
undo();
|
undo();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
alert.setNegativeButton(com.ddns.kauron.dungeonmanager.R.string.die, new DialogInterface.OnClickListener() {
|
alert.setNegativeButton(com.kauron.dungeonmanager.R.string.die, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.message_death,
|
com.kauron.dungeonmanager.R.string.message_death,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
getSharedPreferences("basics", MODE_PRIVATE).edit().clear().apply();
|
getSharedPreferences("basics", MODE_PRIVATE).edit().clear().apply();
|
||||||
|
@ -246,7 +246,7 @@ public class MainActivity extends ActionBarActivity
|
||||||
if(lastState != Player.SAME) {
|
if(lastState != Player.SAME) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.state_changed_debilitado,
|
com.kauron.dungeonmanager.R.string.state_changed_debilitado,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
|
@ -256,13 +256,13 @@ public class MainActivity extends ActionBarActivity
|
||||||
if(lastState != Player.SAME) {
|
if(lastState != Player.SAME) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
com.ddns.kauron.dungeonmanager.R.string.state_changed_malherido,
|
com.kauron.dungeonmanager.R.string.state_changed_malherido,
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pg.setTextColor(getResources().getColor(
|
pg.setTextColor(getResources().getColor(
|
||||||
com.ddns.kauron.dungeonmanager.R.color.abc_primary_text_material_dark
|
com.kauron.dungeonmanager.R.color.abc_primary_text_material_dark
|
||||||
));
|
));
|
||||||
pg.setBackgroundColor(android.R.drawable.btn_default);
|
pg.setBackgroundColor(android.R.drawable.btn_default);
|
||||||
}
|
}
|
||||||
|
@ -281,9 +281,9 @@ public class MainActivity extends ActionBarActivity
|
||||||
}
|
}
|
||||||
if(player == null) {
|
if(player == null) {
|
||||||
player = new Player(
|
player = new Player(
|
||||||
p.getString("playerName", getString(com.ddns.kauron.dungeonmanager.R.string.adventurer_name)),
|
p.getString("playerName", getString(com.kauron.dungeonmanager.R.string.adventurer_name)),
|
||||||
p.getString("className", getString(com.ddns.kauron.dungeonmanager.R.string.class_name)),
|
p.getString("className", getString(com.kauron.dungeonmanager.R.string.class_name)),
|
||||||
p.getString("raceName", getString(com.ddns.kauron.dungeonmanager.R.string.race_name)),
|
p.getString("raceName", getString(com.kauron.dungeonmanager.R.string.race_name)),
|
||||||
p.getInt("level", 1),
|
p.getInt("level", 1),
|
||||||
new int[] {
|
new int[] {
|
||||||
p.getInt("fue", 10),
|
p.getInt("fue", 10),
|
||||||
|
@ -296,9 +296,9 @@ public class MainActivity extends ActionBarActivity
|
||||||
new int[18],
|
new int[18],
|
||||||
new Power[4]);
|
new Power[4]);
|
||||||
} else {
|
} else {
|
||||||
player.setName(p.getString("playerName", getString(com.ddns.kauron.dungeonmanager.R.string.adventurer_name)));
|
player.setName(p.getString("playerName", getString(com.kauron.dungeonmanager.R.string.adventurer_name)));
|
||||||
player.setClassName(p.getString("className", getString(com.ddns.kauron.dungeonmanager.R.string.class_name)));
|
player.setClassName(p.getString("className", getString(com.kauron.dungeonmanager.R.string.class_name)));
|
||||||
player.setRaceName(p.getString("raceName", getString(com.ddns.kauron.dungeonmanager.R.string.race_name)));
|
player.setRaceName(p.getString("raceName", getString(com.kauron.dungeonmanager.R.string.race_name)));
|
||||||
player.setLevel(p.getInt("level", 1));
|
player.setLevel(p.getInt("level", 1));
|
||||||
//TODO: restore pg
|
//TODO: restore pg
|
||||||
player.setAtk(new int[]{
|
player.setAtk(new int[]{
|
||||||
|
@ -309,49 +309,52 @@ public class MainActivity extends ActionBarActivity
|
||||||
p.getInt("sab", 10),
|
p.getInt("sab", 10),
|
||||||
p.getInt("car", 10),
|
p.getInt("car", 10),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
player.setPg(p.getInt("pg", player.getMaxPg()));
|
||||||
healthStatusCheck();
|
healthStatusCheck();
|
||||||
updateCurativeString();
|
updateCurativeString();
|
||||||
}
|
|
||||||
//set restored values to the respective fields
|
//set restored values to the respective fields
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.nameText)).setText(player.getName());
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.nameText)).setText(player.getName());
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.raceText)).setText(player.getRaceName());
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.raceText)).setText(player.getRaceName());
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.classText)).setText(player.getClassName());
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.classText)).setText(player.getClassName());
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.lvl)).setText(String.valueOf(player.getLevel()));
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.lvl)).setText(String.valueOf(player.getLevel()));
|
||||||
|
|
||||||
((Button) findViewById(com.ddns.kauron.dungeonmanager.R.id.pgCurrent)).setText(String.valueOf(player.getPg()));
|
((Button) findViewById(com.kauron.dungeonmanager.R.id.pgCurrent)).setText(String.valueOf(player.getPg()));
|
||||||
|
|
||||||
//attacks
|
//attacks
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.FUE)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.FUE)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.FUE) + ":" + player.getFue()
|
getString(com.kauron.dungeonmanager.R.string.FUE) + ":" + player.getFue()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.CON)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.CON)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.CON) + ":" + player.getCon()
|
getString(com.kauron.dungeonmanager.R.string.CON) + ":" + player.getCon()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.DES)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.DES)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.DES) + ":" + player.getDes()
|
getString(com.kauron.dungeonmanager.R.string.DES) + ":" + player.getDes()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.INT)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.INT)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.INT) + ":" + player.getInt()
|
getString(com.kauron.dungeonmanager.R.string.INT) + ":" + player.getInt()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.SAB)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.SAB)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.SAB) + ":" + player.getSab()
|
getString(com.kauron.dungeonmanager.R.string.SAB) + ":" + player.getSab()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.CAR)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.CAR)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.CAR) + ":" + player.getCar()
|
getString(com.kauron.dungeonmanager.R.string.CAR) + ":" + player.getCar()
|
||||||
);
|
);
|
||||||
|
|
||||||
//defenses
|
//defenses
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.CA)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.CA)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.CA) + ": " + player.getCa()
|
getString(com.kauron.dungeonmanager.R.string.CA) + ": " + player.getCa()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.FORT)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.FORT)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.FORT) + ": " + player.getFort()
|
getString(com.kauron.dungeonmanager.R.string.FORT) + ": " + player.getFort()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.REF)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.REF)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.REF) + ": " + player.getRef()
|
getString(com.kauron.dungeonmanager.R.string.REF) + ": " + player.getRef()
|
||||||
);
|
);
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.VOL)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.VOL)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.VOL) + ": " + player.getVol()
|
getString(com.kauron.dungeonmanager.R.string.VOL) + ": " + player.getVol()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -368,22 +371,22 @@ public class MainActivity extends ActionBarActivity
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private void updateCurativeString() {
|
private void updateCurativeString() {
|
||||||
((TextView) findViewById(com.ddns.kauron.dungeonmanager.R.id.curativeEffortsText)).setText(
|
((TextView) findViewById(com.kauron.dungeonmanager.R.id.curativeEffortsText)).setText(
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.curative_display_text1) + " " +
|
getString(com.kauron.dungeonmanager.R.string.curative_display_text1) + " " +
|
||||||
player.getCurativeEfforts() + " " +
|
player.getCurativeEfforts() + " " +
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.curative_display_text2) + " " +
|
getString(com.kauron.dungeonmanager.R.string.curative_display_text2) + " " +
|
||||||
player.getMaxCurativeEfforts() + " " +
|
player.getMaxCurativeEfforts() + " " +
|
||||||
getString(com.ddns.kauron.dungeonmanager.R.string.curative_display_text3)
|
getString(com.kauron.dungeonmanager.R.string.curative_display_text3)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void undo() {
|
private void undo() {
|
||||||
String message = "";
|
String message = "";
|
||||||
if(undoObject == CURRENT_PG){
|
if(undoObject == CURRENT_PG){
|
||||||
((Button) findViewById(com.ddns.kauron.dungeonmanager.R.id.pgCurrent)).setText(String.valueOf(undoPreviousValue));
|
((Button) findViewById(com.kauron.dungeonmanager.R.id.pgCurrent)).setText(String.valueOf(undoPreviousValue));
|
||||||
player.setPg(undoPreviousValue);
|
player.setPg(undoPreviousValue);
|
||||||
undoObject = NULL;
|
undoObject = NULL;
|
||||||
message = getString(com.ddns.kauron.dungeonmanager.R.string.action_undo_current_pg);
|
message = getString(com.kauron.dungeonmanager.R.string.action_undo_current_pg);
|
||||||
}
|
}
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getApplicationContext(),
|
getApplicationContext(),
|
||||||
|
|
Reference in a new issue