# HG changeset patch
# User Xeli
# Date 1319149686 -7200
# Node ID 88fb92444d1973b64cdfeb30009b4649f9af522b
# Parent 7bc38086d771907581729bc463506b846457b9cf
Added two default teams to the apk, so people who first download it don't have to make two teams before playing their first game
diff -r 7bc38086d771 -r 88fb92444d19 project_files/Android-build/SDL-android-project/res/raw/team_one.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_one.xml Fri Oct 21 00:28:06 2011 +0200
@@ -0,0 +1,49 @@
+
+
+ Team 1
+ cm_cog
+ Cake
+ coffin
+ Classic
+ 0
+
+ Leonidas
+ spartan
+ 0
+
+
+ Pipo
+ clown-copper
+ 0
+
+
+ Sonic
+ Sonic
+ 0
+
+
+ Xin
+ StrawHat
+ 0
+
+
+ Arnold
+ cyborg
+ 0
+
+
+ Jack
+ Pumpkin_Hat
+ 0
+
+
+ Tom
+ Samurai
+ 0
+
+
+ Goldie
+ diglett
+ 0
+
+
\ No newline at end of file
diff -r 7bc38086d771 -r 88fb92444d19 project_files/Android-build/SDL-android-project/res/raw/team_two.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_two.xml Fri Oct 21 00:28:06 2011 +0200
@@ -0,0 +1,49 @@
+
+
+ Team 2
+ cm_42
+ Plane
+ pyramid
+ Singer
+ 0
+
+ Paris
+ pinksunhat
+ 3
+
+
+ Knut
+ sth_Knux
+ 3
+
+
+ Ash
+ RedCap
+ 3
+
+
+ Woad
+ Toad
+ 3
+
+
+ Bob
+ rasta
+ 3
+
+
+ Corky
+ porkey
+ 3
+
+
+ Bea
+ crown
+ 3
+
+
+ Silvia
+ Rambo
+ 3
+
+
\ No newline at end of file
diff -r 7bc38086d771 -r 88fb92444d19 project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml
--- a/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml Thu Oct 20 23:07:53 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml Fri Oct 21 00:28:06 2011 +0200
@@ -25,4 +25,10 @@
- @raw/weapon_promode
- @raw/weapon_shoppa
+
+
+ - @raw/team_one
+ - @raw/team_two
+
+
diff -r 7bc38086d771 -r 88fb92444d19 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java Thu Oct 20 23:07:53 2011 +0200
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java Fri Oct 21 00:28:06 2011 +0200
@@ -28,9 +28,11 @@
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.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
@@ -53,11 +55,17 @@
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
- //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean firstTime = sharedPref.getBoolean("firstTime", true);
//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);
+ if(firstTime){
+ sharedPref.edit().putBoolean("firstTime", false).commit();
+
+ Utils.resRawToFilesDir(this,R.array.schemes, Scheme.DIRECTORY_SCHEME);
+ Utils.resRawToFilesDir(this, R.array.weapons, Weapon.DIRECTORY_WEAPON);
+ Utils.resRawToFilesDir(this, R.array.teams, Team.DIRECTORY_TEAMS);
+ Scheme.parseBasicFlags(this);
+ }
config = new GameConfig();
@@ -76,7 +84,7 @@
themeIcon = (ImageView) findViewById(R.id.imgTheme);
mapPreview = (ImageView) findViewById(R.id.mapPreview);
teamCount = (ImageView) findViewById(R.id.imgTeamsCount);
-
+
start.setOnClickListener(startClicker);
back.setOnClickListener(backClicker);
team.setOnClickListener(teamClicker);
@@ -113,7 +121,7 @@
i.putParcelableArrayListExtra("teams", config.teams);
startActivityForResult(i, ACTIVITY_TEAM_SELECTOR);
}
-
+
public void onActivityResult(int requestCode, int resultCode, Intent data){
switch(requestCode){
case ACTIVITY_TEAM_SELECTOR:
@@ -123,7 +131,7 @@
for(Parcelable t : parcelables){
config.teams.add((Team)t);
}
- teamCount.getDrawable().setLevel(config.teams.size());
+ teamCount.getDrawable().setLevel(config.teams.size());
}
break;
}