diff --git a/app/src/main/java/com/simplecoil/simplecoil/PlayerDisplayDataListAdapter.java b/app/src/main/java/com/simplecoil/simplecoil/PlayerDisplayDataListAdapter.java index a296569..b350dcb 100644 --- a/app/src/main/java/com/simplecoil/simplecoil/PlayerDisplayDataListAdapter.java +++ b/app/src/main/java/com/simplecoil/simplecoil/PlayerDisplayDataListAdapter.java @@ -67,7 +67,28 @@ public View getView(int position, View view, ViewGroup parent) { playerIDTV.setText(data[position].playerName); return rowView; } - playerIDTV.setText("" + position); + switch (Globals.getInstance().mGameMode) { + case Globals.GAME_MODE_FFA: + playerIDTV.setText("" + position); + break; + case Globals.GAME_MODE_2TEAMS: + if (position > Globals.MAX_PLAYER_ID / 2) + playerIDTV.setText("2-" + (position - (Globals.MAX_PLAYER_ID / 2))); + else + playerIDTV.setText("1-" + position); + break; + case Globals.GAME_MODE_4TEAMS: + int playersPerTeam = Globals.MAX_PLAYER_ID / 4; + if (position > playersPerTeam * 3) + playerIDTV.setText("4-" + (position - (playersPerTeam * 3))); + else if (position > playersPerTeam * 2) + playerIDTV.setText("3-" + (position - (playersPerTeam * 2))); + else if (position > playersPerTeam) + playerIDTV.setText("2-" + (position - playersPerTeam)); + else + playerIDTV.setText("1-" + position); + break; + } if (data[position] == null) { playerNameTV.setText(R.string.player_name_not_connected); playerPointsTV.setText(""); diff --git a/app/src/main/java/com/simplecoil/simplecoil/PlayerSettingsAlertDialog.java b/app/src/main/java/com/simplecoil/simplecoil/PlayerSettingsAlertDialog.java index 342c53a..a915fc9 100644 --- a/app/src/main/java/com/simplecoil/simplecoil/PlayerSettingsAlertDialog.java +++ b/app/src/main/java/com/simplecoil/simplecoil/PlayerSettingsAlertDialog.java @@ -75,7 +75,28 @@ public void getServerSettings() { Globals.PlayerSettings playerSettings = Globals.getInstance().mPlayerSettings.get(mPlayerID); if (playerSettings == null) playerSettings = new Globals.PlayerSettings(); - mTitleTV.setText(mContext.getString(R.string.player_settings_id_title, mPlayerID)); + switch (Globals.getInstance().mGameMode) { + case Globals.GAME_MODE_FFA: + mTitleTV.setText(mContext.getString(R.string.player_settings_id_title, mPlayerID)); + break; + case Globals.GAME_MODE_2TEAMS: + if (mPlayerID > Globals.MAX_PLAYER_ID / 2) + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 2, (mPlayerID - (Globals.MAX_PLAYER_ID / 2)))); + else + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 1, mPlayerID)); + break; + case Globals.GAME_MODE_4TEAMS: + int playersPerTeam = Globals.MAX_PLAYER_ID / 4; + if (mPlayerID > playersPerTeam * 3) + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 4, (mPlayerID - (playersPerTeam * 3)))); + else if (mPlayerID > playersPerTeam * 2) + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 3, (mPlayerID - (playersPerTeam * 2)))); + else if (mPlayerID > playersPerTeam) + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 2, (mPlayerID - playersPerTeam))); + else + mTitleTV.setText(mContext.getString(R.string.player_settings_team_title, 1, mPlayerID)); + break; + } mHealthET.setText("" + playerSettings.health); mReloadShotsET.setText("" + playerSettings.shots); mReloadTimeET.setText("" + playerSettings.reloadTime); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 13b20ae..f12c12c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -127,6 +127,7 @@ Player Settings Player Settings (%1$d) + Player Settings (%1$d-%2$d) Player Settings Health Respawn Time (Seconds)