Changeset bb2fa26 in advance-wars for src/com/medievaltech/advancewars/GameView.java
- Timestamp:
- Jan 19, 2015, 10:25:28 PM (10 years ago)
- Branches:
- master
- Parents:
- 4666fae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/advancewars/GameView.java
r4666fae rbb2fa26 12 12 import android.os.*; 13 13 import android.view.*; 14 import android.view.ContextMenu.ContextMenuInfo; 14 15 import android.util.AttributeSet; 15 16 import android.util.Log; … … 209 210 } 210 211 } 211 212 /** Pointer to the text view to display "Paused.." etc. */ 213 //private TextView mStatusText; 214 212 215 213 public GameView(Context context, AttributeSet attrs) { 216 214 super(context, attrs); … … 233 231 switch(Static.gameState) { 234 232 case MAIN_MENU: 235 Log.i("AdvanceWars", "Switching to battle map");236 233 if(Static.wndMainMenu.getGUIObject("btnNewGame").isClicked(event.getX(), event.getY())) { 234 Log.i("AdvanceWars", "Switching to battle map"); 237 235 Static.gameState = GameState.BATTLE_MAP; 238 236 }else if(Static.wndMainMenu.getGUIObject("btnLoadGame").isClicked(event.getX(), event.getY())) { … … 293 291 int y = ((int)event.getY() - Static.map.offset.y) / 50; 294 292 293 Log.i("AdvanceWars", "About to show context menu"); 294 showContextMenu(); 295 296 /* 297 295 298 Unit target = Static.map.getTile(x, y).currentUnit; 296 299 297 300 if(Static.thread.selectedUnit != null && Static.thread.selectedUnit.getMovementRange().contains(new Point(x, y))) { 301 //Display a menu allowing the player to move to the target or attack the target or 302 //get more info on the target 303 298 304 if(target == null || target == Static.thread.selectedUnit) { 299 305 Static.map.getTile(Static.thread.selectedUnit.location.x, Static.thread.selectedUnit.location.y).removeUnit(); 300 306 Static.map.getTile(x, y).addUnit(Static.thread.selectedUnit); 301 307 }else { 302 // the target contains another unit. If the unit is enemy-controlled, attack it308 // Display a context menu that gives the option of attacking the target 303 309 } 304 310 Static.thread.selectedUnit = null; 305 311 }else 306 312 Static.thread.selectedUnit = target; 313 */ 307 314 } 308 315
Note:
See TracChangeset
for help on using the changeset viewer.