# HG changeset patch
# User Xeli
# Date 1313943289 -7200
# Node ID 9add7b92c5f08ceb76bb93763061f35672f943fc
# Parent df23b477609dcd07601073c2fc064ece61b4b926
Added a check for team count to prevent the engine from crashes when starting with <2 teams + changed the text in the Teams selection menu
diff -r df23b477609d -r 9add7b92c5f0 project_files/Android-build/SDL-android-project/res/layout/team_selector.xml
--- a/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml Sun Aug 21 18:13:11 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml Sun Aug 21 18:14:49 2011 +0200
@@ -28,8 +28,7 @@
android:layout_alignTop="@id/btnBack"
android:layout_margin="3dp"
android:gravity="center"
- android:background="@drawable/box"
- android:text="bla"/>
+ android:background="@drawable/box"/>
diff -r df23b477609d -r 9add7b92c5f0 project_files/Android-build/SDL-android-project/res/values/strings.xml
--- a/project_files/Android-build/SDL-android-project/res/values/strings.xml Sun Aug 21 18:13:11 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/res/values/strings.xml Sun Aug 21 18:14:49 2011 +0200
@@ -29,6 +29,11 @@
Filter
Themes
+
+
+
+ Not enough teams
+ Selected teams = %d
Name
Unnamed
diff -r df23b477609d -r 9add7b92c5f0 project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/StartGameActivity.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/StartGameActivity.java Sun Aug 21 18:13:11 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/StartGameActivity.java Sun Aug 21 18:14:49 2011 +0200
@@ -19,8 +19,6 @@
package org.hedgewars.mobile;
-import java.util.ArrayList;
-
import org.hedgewars.mobile.EngineProtocol.FrontendDataUtils;
import org.hedgewars.mobile.EngineProtocol.GameConfig;
import org.hedgewars.mobile.EngineProtocol.Map;
@@ -30,12 +28,9 @@
import android.app.Activity;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
-import android.preference.PreferenceManager;
-import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
@@ -44,6 +39,7 @@
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Spinner;
+import android.widget.Toast;
public class StartGameActivity extends Activity {
@@ -57,19 +53,20 @@
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
- SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
-
+ //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ //Copy all the xml files to the device TODO only do first time launch of the app...
Utils.resRawToFilesDir(this,R.array.schemes, Scheme.DIRECTORY_SCHEME);
Utils.resRawToFilesDir(this, R.array.weapons, Weapon.DIRECTORY_WEAPON);
Scheme.parseBasicFlags(this);
+
config = new GameConfig();
setContentView(R.layout.starting_game);
-
+
back = (ImageButton) findViewById(R.id.btnBack);
team = (ImageButton) findViewById(R.id.btnTeams);
start = (ImageButton) findViewById(R.id.btnStart);
-
+
maps = (Spinner) findViewById(R.id.spinMaps);
gameplay = (Spinner) findViewById(R.id.spinGameplay);
gamescheme = (Spinner) findViewById(R.id.spinGamescheme);
@@ -82,7 +79,7 @@
start.setOnClickListener(startClicker);
back.setOnClickListener(backClicker);
team.setOnClickListener(teamClicker);
-
+
ArrayAdapter> adapter = new ArrayAdapter