Changeset bb2fa26 in advance-wars for src/com/medievaltech/advancewars/Game.java


Ignore:
Timestamp:
Jan 19, 2015, 10:25:28 PM (10 years ago)
Author:
dportnoy <devnull@…>
Branches:
master
Parents:
4666fae
Message:

Add a menu for in-game actions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/com/medievaltech/advancewars/Game.java

    r4666fae rbb2fa26  
    66import android.os.Bundle;
    77import android.util.Log;
     8import android.view.ContextMenu;
    89import android.view.Menu;
     10import android.view.MenuInflater;
    911import android.view.MenuItem;
     12import android.view.View;
     13import android.view.ContextMenu.ContextMenuInfo;
    1014import android.view.Window;
    1115
     
    7781        // turn off the window's title bar
    7882        requestWindowFeature(Window.FEATURE_NO_TITLE);
    79 
     83       
    8084        // tell system to use the layout defined in our XML file
    8185        setContentView(R.layout.main);
    82 
     86       
     87        /*View v = findViewById(R.id.main_view);
     88        Log.i("AdvanceWars", "view is null?: " + (v==null));*/
     89       
    8390        Static.game = this;
    8491
     
    9097            Static.gameState = (GameState)savedInstanceState.getSerializable("gameState");
    9198        }
     99    }
     100   
     101    @Override
     102    public void onCreateContextMenu(ContextMenu menu, View v,
     103                                    ContextMenuInfo menuInfo) {
     104      super.onCreateContextMenu(menu, v, menuInfo);
     105      MenuInflater inflater = getMenuInflater();
     106      inflater.inflate(R.menu.map_menu, menu);
    92107    }
    93108
Note: See TracChangeset for help on using the changeset viewer.