Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WW3Activity extends Activity
- {
- public boolean DebugMode = false;
- private String buildMenuEmplacement = "";
- //[Initialization] Called when the app is first launched
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.startscreen);
- //[Initialization] Makes the button resources available to the class
- final Button newGame = (Button) findViewById(R.id.buttonNewGame);
- final Button loadGame = (Button) findViewById(R.id.buttonLoadGame);
- final Button exitGame = (Button) findViewById(R.id.buttonExit);
- final Button about = (Button) findViewById(R.id.buttonAbout);
- final Button troll = (Button) findViewById(R.id.buttonTroll);
- final Button debug = (Button) findViewById(R.id.buttonDebug);
- //[Action] When user pushes the New Game button
- newGame.setOnClickListener(new View.OnClickListener()
- {
- public void onClick(View v)
- {
- // Perform action on click
- setContentView(R.layout.main);
- buttonInitialize();
- }
- });
- //[Action] When user pushes the Exit Game button
- exitGame.setOnClickListener(new View.OnClickListener()
- {
- public void onClick(View v)
- {
- // Perform action on click
- finish();
- }
- });
- //[Action] When user pushes the Debug Mode button
- exitGame.setOnClickListener(new View.OnClickListener()
- {
- public void onClick(View v)
- {
- // Perform action on click
- DebugMode = true;
- }
- });
- }
- //[Initialization] Gets the emplacements ready to be pushed
- public void buttonInitialize()
- {
- final ImageView pe1 = (ImageView) findViewById(R.id.playerEmplacement1);
- final ImageView pe2 = (ImageView) findViewById(R.id.playerEmplacement2);
- final ImageView pe3 = (ImageView) findViewById(R.id.playerEmplacement3);
- final ImageView pc = (ImageView) findViewById(R.id.playerCity);
- final ImageView ee1 = (ImageView) findViewById(R.id.enemyEmplacement1);
- final ImageView ee2 = (ImageView) findViewById(R.id.enemyEmplacement2);
- final ImageView ee3 = (ImageView) findViewById(R.id.enemyEmplacement3);
- final ImageView ec = (ImageView) findViewById(R.id.enemyCity);
- registerForContextMenu(findViewById(R.id.playerEmplacement1));
- registerForContextMenu(findViewById(R.id.playerEmplacement2));
- registerForContextMenu(findViewById(R.id.playerEmplacement3));
- registerForContextMenu(findViewById(R.id.enemyEmplacement1));
- registerForContextMenu(findViewById(R.id.enemyEmplacement2));
- registerForContextMenu(findViewById(R.id.enemyEmplacement3));
- /*empAction(pe1);
- empAction(pe2);
- empAction(pe3);
- empAction(ee1);
- empAction(ee2);
- empAction(ee3);
- empAction(ec);
- empAction(pc);*/
- }
- And the LogCat:
Advertisement
Add Comment
Please, Sign In to add comment