|
@@ -26,6 +26,8 @@ public class MenuActivity extends AppCompatActivity {
|
|
protected ImageButton mIInventaire;
|
|
protected ImageButton mIInventaire;
|
|
protected ImageButton mIOptions;
|
|
protected ImageButton mIOptions;
|
|
protected ImageButton mIScanner;
|
|
protected ImageButton mIScanner;
|
|
|
|
+ protected ImageButton mIBriefing;
|
|
|
|
+ protected ImageButton mINextStage;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -33,33 +35,25 @@ public class MenuActivity extends AppCompatActivity {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_menu);
|
|
setContentView(R.layout.activity_menu);
|
|
|
|
|
|
- Display display = getWindowManager().getDefaultDisplay();
|
|
|
|
- Point size = new Point();
|
|
|
|
- display.getSize(size);
|
|
|
|
- int width = size.x;
|
|
|
|
- int height = size.y;
|
|
|
|
- int buttonHieght = (height-5*40)/6;
|
|
|
|
mICarte = (ImageButton) findViewById(R.id.ib_carte);
|
|
mICarte = (ImageButton) findViewById(R.id.ib_carte);
|
|
mIInventaire = (ImageButton) findViewById(R.id.ib_inventaire);
|
|
mIInventaire = (ImageButton) findViewById(R.id.ib_inventaire);
|
|
mIOptions = (ImageButton) findViewById(R.id.ib_options);
|
|
mIOptions = (ImageButton) findViewById(R.id.ib_options);
|
|
mIScanner = (ImageButton) findViewById(R.id.ib_scanner);
|
|
mIScanner = (ImageButton) findViewById(R.id.ib_scanner);
|
|
-
|
|
|
|
- mICarte.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
- mIInventaire.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
- mIOptions.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
- mIScanner.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
|
|
+ mIBriefing = (ImageButton) findViewById(R.id.ib_briefing);
|
|
|
|
|
|
|
|
|
|
Game g = null;//Game.load(this);
|
|
Game g = null;//Game.load(this);
|
|
|
|
|
|
if (g!= null && mGame==null) {
|
|
if (g!= null && mGame==null) {
|
|
mGame = g;
|
|
mGame = g;
|
|
|
|
+ Game.setGame(mGame);
|
|
mGame.newSensorManager(this);
|
|
mGame.newSensorManager(this);
|
|
Toast.makeText(this, "Chargement", Toast.LENGTH_LONG).show();
|
|
Toast.makeText(this, "Chargement", Toast.LENGTH_LONG).show();
|
|
}
|
|
}
|
|
else if( mGame==null)
|
|
else if( mGame==null)
|
|
{
|
|
{
|
|
mGame = new Game("game_medium", this);
|
|
mGame = new Game("game_medium", this);
|
|
|
|
+ Game.setGame(mGame);
|
|
Toast.makeText(this, "Nouveau Jeu", Toast.LENGTH_LONG).show();
|
|
Toast.makeText(this, "Nouveau Jeu", Toast.LENGTH_LONG).show();
|
|
}else if( mGame==null)
|
|
}else if( mGame==null)
|
|
{
|
|
{
|
|
@@ -68,18 +62,30 @@ public class MenuActivity extends AppCompatActivity {
|
|
}
|
|
}
|
|
if(mGame!=null)
|
|
if(mGame!=null)
|
|
{
|
|
{
|
|
- mGame.pickResource("b");
|
|
|
|
|
|
+ /*
|
|
|
|
+ mGame.pickR esource("b");
|
|
mGame.pickResource("c");
|
|
mGame.pickResource("c");
|
|
mGame.pickResource("d");
|
|
mGame.pickResource("d");
|
|
mGame.pickResource("e");
|
|
mGame.pickResource("e");
|
|
|
|
+ */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void onResume()
|
|
public void onResume()
|
|
{
|
|
{
|
|
super.onResume();
|
|
super.onResume();
|
|
- mGame.printNResource("N res Resume");
|
|
|
|
- Log.e("________", "mGame : "+mGame);
|
|
|
|
|
|
+ Display display = getWindowManager().getDefaultDisplay();
|
|
|
|
+ Point size = new Point();
|
|
|
|
+ display.getSize(size);
|
|
|
|
+ int width = size.x;
|
|
|
|
+ int height = size.y;
|
|
|
|
+ int buttonHieght = (height-5*40)/6;
|
|
|
|
+
|
|
|
|
+ mICarte.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
+ mIInventaire.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
+ mIOptions.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
+ mIScanner.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
|
|
+ mIBriefing.setLayoutParams(new LinearLayout.LayoutParams(buttonHieght, buttonHieght));
|
|
}
|
|
}
|
|
|
|
|
|
public void onOptionsClick(View v)
|
|
public void onOptionsClick(View v)
|
|
@@ -121,4 +127,10 @@ public class MenuActivity extends AppCompatActivity {
|
|
intent.putExtra("resource", r );
|
|
intent.putExtra("resource", r );
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void onSendClick(View v)
|
|
|
|
+ {
|
|
|
|
+ //TODO : Transmssion des donnes
|
|
|
|
+ }
|
|
}
|
|
}
|