Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4f963c2
Basic Replay Support
Mimerme Jan 25, 2015
536112c
Leave all rooms onDetach
NamTThai Jan 6, 2015
fd430d6
alert for multiple battle
NamTThai Jan 6, 2015
bb9df1c
Saving tiers
CLEMENTINATOR Jan 6, 2015
c902414
Fixing add pokemon button not reappearing when pokemon removed
CLEMENTINATOR Jan 6, 2015
cf8ccf3
Fixing import with spaces in nicknames
CLEMENTINATOR Jan 6, 2015
ec105d5
Handle uncaught exceptions
NamTThai Jan 7, 2015
dae8a4b
Refactor listener and lifecycle management. Shedinja fix. Stored Powe…
Lazloz Jan 9, 2015
60c152d
Modifiable Health
Lazloz Jan 9, 2015
4db01da
Items are choosable. Support for Judgement, Multitype, Drives, Natura…
Lazloz Jan 9, 2015
597211d
Life Orb. Acrobatics-Flying gem bug.
Lazloz Jan 11, 2015
96797c8
Implemented: Plates, Muscle Band, Wise Glasses, Ring Target, Air Ball…
Lazloz Jan 11, 2015
e6d3abd
Layout tweaks, refactoring sticky bard support
Lazloz Jan 11, 2015
d139626
Refactor arguments
Lazloz Jan 11, 2015
0f35b5a
Rayquaza problem
NamTThai Jan 11, 2015
e80d1a0
Eviolite fix.
Lazloz Jan 11, 2015
65eb3d2
No more negative rounds til ko.
Lazloz Jan 11, 2015
591d25d
derp
Lazloz Jan 11, 2015
f3a2a28
Screen doesn't switch to standby in BattleFragment
Lazloz Jan 14, 2015
03387df
setNatureMultiplier-fix
Lazloz Jan 15, 2015
35363d1
Fixing moves not setting back to empty strings sometimes (reported by…
CLEMENTINATOR Jan 17, 2015
1605ede
Fixing neutral gender in export
CLEMENTINATOR Jan 18, 2015
99b400f
Fixing ivs that cant be 0
CLEMENTINATOR Jan 18, 2015
9983fa7
Update Coding Standards
Mimerme Jan 25, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.pokemonshowdown.data.CommunityLoungeData;
import com.pokemonshowdown.data.MyApplication;
import com.pokemonshowdown.data.Onboarding;
import com.pokemonshowdown.replays.ReplayFragment;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -189,7 +190,7 @@ public void run() {
return true;
case R.id.menu_settings:
new AlertDialog.Builder(this)
.setMessage(R.string.teaser_alert)
.setMessage(R.string.still_in_development)
.create()
.show();
return true;
Expand Down Expand Up @@ -230,13 +231,18 @@ private void selectItem(int position) {
mPosition = 1;
fragment = CommunityLoungeFragment.newInstance();
break;
case 2:
mPosition = 2;
fragment = ReplayFragment.newInstance();
break;
case 3:
mPosition = 3;
fragment = CreditsFragment.newInstance();
break;
default:
mPosition = 2;
fragment = new PlaceHolderFragment();
break;
}

FragmentManager fm = getSupportFragmentManager();
Expand Down Expand Up @@ -351,6 +357,22 @@ public void run() {
mDialog.show();
}
});
return;
case MyApplication.EXTRA_UNKNOWN_ERROR:
runOnUiThread(new Runnable() {
@Override
public void run() {
if (mDialog != null && mDialog.isShowing()) {
mDialog.dismiss();
}
mDialog = new AlertDialog.Builder(BattleFieldActivity.this)
.setMessage("An unknown error was caught. " +
"You can copy current roomId to clipboard; if anything funny happens," +
" finish the battle in your device's browser.")
.create();
mDialog.show();
}
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void onDetach() {
super.onDetach();
getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
getActivity().getActionBar().removeAllTabs();
BattleFieldData.get(getActivity()).leaveAllRooms();
}

@Override
Expand All @@ -103,7 +104,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
final String roomId = getCurrentRoomId();
final String roomId = "http://play.pokemonshowdown.com/" + getCurrentRoomId();
new AlertDialog.Builder(getActivity())
.setTitle(R.string.bar_room_id)
.setMessage(roomId)
Expand Down Expand Up @@ -290,6 +291,14 @@ public void processNewRoomRequest(String roomId) {
fragment.cancelSearchingButton();
}
}

if (mRoomList.size() > 2) {
new AlertDialog.Builder(getActivity())
.setMessage("This app does not handle concurrent battles well =.= " +
"Not just yet =.= Don't close any window, finish all battles and reset the app")
.create()
.show();
}
}

public void generateAvailableWatchBattleDialog() {
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/java/com/pokemonshowdown/app/BattleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public void onResume() {
@Override
public void onPause() {
super.onPause();
Log.d(BTAG, "onPause");
BattleFieldData.RoomData roomData = BattleFieldData.get(getActivity()).getAnimationInstance(mRoomId);
if (roomData != null) {
roomData.setMessageListener(true);
Expand Down Expand Up @@ -1248,12 +1249,14 @@ public void displayPokemon(String tag) {
getView().findViewById(getSpriteId(tag)).setAlpha(1f);
if (!isBatonPass()) {
((LinearLayout) getView().findViewById(getTempStatusId(tag))).removeAllViews();
} else {
getView().findViewById(getSpriteId(tag)).setAlpha(0.2f);
}
ImageView sub = (ImageView) relativeLayout.findViewWithTag("Substitute");
if (sub != null && !isBatonPass()) {
relativeLayout.removeView(sub);
if (sub != null) {
if (!isBatonPass()) {
relativeLayout.removeView(sub);
} else {
getView().findViewById(getSpriteId(tag)).setAlpha(0.2f);
}
}
setBatonPass(false);
} catch (NullPointerException e) {
Expand Down Expand Up @@ -2044,7 +2047,7 @@ public void onAnimationStart(Animator animation) {
layoutParams.addRule(RelativeLayout.ALIGN_LEFT, getSpriteId(tag));
layoutParams.setMargins((int) (imageView.getWidth() * 0.25f), (int) (imageView.getHeight() * 0.5f), 0, 0);
relativeLayout.addView(flyingMessage, layoutParams);
} catch (NullPointerException e) {
} catch (Exception e) {

}
}
Expand All @@ -2054,7 +2057,7 @@ public void onAnimationEnd(Animator animation) {
try {
RelativeLayout relativeLayout = (RelativeLayout) getView().findViewById(getPkmLayoutId(tag));
relativeLayout.removeView(flyingMessage);
} catch (NullPointerException e) {
} catch (Exception e) {

}
}
Expand Down
Loading