Imrpoved undo
|
@ -64,6 +64,7 @@ public class Introduction extends ActionBarActivity {
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
Toast.makeText(
|
||||
getApplicationContext(),
|
||||
R.string.message_no_back_button_intro,
|
||||
|
|
|
@ -57,7 +57,6 @@ public class MainActivity extends ActionBarActivity{
|
|||
.setColorFilter(Color.parseColor("#62BACE"), PorterDuff.Mode.SRC_IN);
|
||||
curativeEffortsBar.getProgressDrawable()
|
||||
.setColorFilter(Color.parseColor("#FFD700"), PorterDuff.Mode.SRC_IN);
|
||||
//TODO: use the negative PG bar, not curativeEfforts one
|
||||
undo = false;
|
||||
//begin
|
||||
restoreData();
|
||||
|
@ -77,7 +76,11 @@ public class MainActivity extends ActionBarActivity{
|
|||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu (Menu menu) {
|
||||
menu.findItem(R.id.action_undo).setVisible(undo);
|
||||
menu.findItem(R.id.action_undo).setEnabled(undo);
|
||||
if (undo)
|
||||
menu.findItem(R.id.action_undo).getIcon().setAlpha(255);
|
||||
else
|
||||
menu.findItem(R.id.action_undo).getIcon().setAlpha(128);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -120,7 +123,6 @@ public class MainActivity extends ActionBarActivity{
|
|||
//levelUp
|
||||
//TODO: update defenses
|
||||
//TODO: add attack points when necessary
|
||||
//TODO: update currentPg button
|
||||
//TODO: improve leveling up
|
||||
player.setMaxPgOnLevelUp();
|
||||
lvl.setText(
|
||||
|
@ -496,11 +498,13 @@ public class MainActivity extends ActionBarActivity{
|
|||
undoObject = NULL;
|
||||
message = getString(R.string.action_undo_current_pg);
|
||||
}
|
||||
Toast.makeText(
|
||||
getApplicationContext(),
|
||||
message,
|
||||
Toast.LENGTH_LONG
|
||||
).show();
|
||||
if (!message.isEmpty()) {
|
||||
Toast.makeText(
|
||||
getApplicationContext(),
|
||||
message,
|
||||
Toast.LENGTH_LONG
|
||||
).show();
|
||||
}
|
||||
pgUpdate();
|
||||
undo = false;
|
||||
invalidateOptionsMenu();
|
||||
|
@ -599,7 +603,6 @@ public class MainActivity extends ActionBarActivity{
|
|||
}
|
||||
|
||||
|
||||
//TODO: show on screen the max pg's
|
||||
// if(progressBar.getId() == R.id.pgBar) {
|
||||
// double rate = (double)current / progressBar.getMax() * (negative ? -1:1);
|
||||
// if (rate <= 0) {
|
||||
|
|
|
@ -217,7 +217,7 @@ public class Player {
|
|||
public void setRaceInt(int raceInt) {this.raceInt= raceInt;}
|
||||
public int getRaceInt() {return raceInt;}
|
||||
|
||||
//TODO: implement time in the app
|
||||
//TODO: implement turns (for bonuses and continuous damage in the app
|
||||
public void rest(boolean isLong) {
|
||||
if(isLong) {
|
||||
pg = maxPg;
|
||||
|
|
Before Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 798 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 490 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 1.7 KiB |
|
@ -1,6 +1,8 @@
|
|||
<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:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
|
@ -22,11 +24,11 @@
|
|||
android:onClick="onNewClick" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/load_character"
|
||||
android:id="@+id/loadCharacter"
|
||||
android:onClick="onLoadClick"
|
||||
android:layout_marginTop="10dp" />
|
||||
android:onClick="onLoadClick" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<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=".MainActivity">
|
||||
<!--TODO: create fancy responsive toasts-->
|
||||
<!--TODO: create fancy responsive toasts for undo's-->
|
||||
<item
|
||||
android:id="@+id/action_undo"
|
||||
android:title="@string/action_undo"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="never"
|
||||
app:showAsAction="ifRoom"
|
||||
android:icon="@drawable/ic_action_undo"/>
|
||||
<item
|
||||
android:id="@+id/action_cure"
|
||||
|
|