diff options
author | frogbotherer <therealchriswest@hotmail.com> | 2012-09-08 13:40:44 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-09-08 13:40:44 +0200 |
commit | f4002528321dbb23f92bade00d46ce515dd1bd27 (patch) | |
tree | c4c8a91fdbe7f14f4a6d66f59f0b1e8429a553f8 /crawl-ref/source/viewmap.cc | |
parent | 58ccbffacfa6feedebee83d6fc22b9037f29bf92 (diff) | |
download | crawl-ref-f4002528321dbb23f92bade00d46ce515dd1bd27.tar.gz crawl-ref-f4002528321dbb23f92bade00d46ce515dd1bd27.zip |
Android port.
2 files are added to the root of the repository:
* AndroidAppSettings.cfg: settings file required for Android SDL port. Will
change on each minor release to reset configuration.
* AndroidBuild.sh: script called by the Android SDL port to commence building
the game itself
It might be nice to be able to move them elsewhere, but for now, their
presence here is required.
The build process is documented in docs/develop/android.txt
There's a TOUCH_UI compiler flag which sets all the things specific to a
touch screen interface.
There has been a large amount of changes in the Makefile for redefining where
the dat/, saves/, etc. directories go, because the "install" part of the make
isn't the final destination for these files under Android - the environment we
deploy to is a separate device from the build environment.
There is also a number of changes to the tiles interface. Some are specific
to the TOUCH_UI, but others are also changed in USE_TILE_LOCAL.
Touch only:
* 'a'bilities menu goes straight to menu without prompting first
* tap menu header to toggle/submit
* menu instead of prompt to select which corpse to butcher
* same for eating food from the floor (those 2 could go in local tiles too)
* show_more defaults to false and less --more-- messages
* pickup mode defaults to menu
* defaults for tile_layout_priority is different (commands are more
important than inventory)
* popup for yes/no prompts, level-up stat gain and swapping rings (should
be used for all prompts, and probably local tiles too)
* spell casting: force selection menu
* map mode: left-click rather than right-click for mouse mode; autotravel on
left-click removed
* remove skills training and memorisation panels
Also local tiles (some could also be integrated in webtiles):
* commands below description are clickable
* clickable shopping menu (uses PrecisionMenu)
* split the command panel in 2 (common actions and system commands)
* add a map command panel
* tapping or left-clicking the player is smarter:
* picks up the item if there's one on the tile, otherwise
* shows pick-up menu if there's several items on the tile, otherwise
* traverses stairs (or enters a portal or shop) if one is present, otherwise
* prays if an altar is present, otherwise
* waits one turn
* right-clicking the map enters map mode and brings the map commands tab to
the front; map mode stays until exited rather than upon release of mouse
Some more details can be found in android_patch_notes.txt on #5677 (although
some TODOs are already obsolete).
Signed-off-by: Raphael Langella <raphael.langella@gmail.com>
Diffstat (limited to 'crawl-ref/source/viewmap.cc')
-rw-r--r-- | crawl-ref/source/viewmap.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc index f22e747a0d..ee66cc4020 100644 --- a/crawl-ref/source/viewmap.cc +++ b/crawl-ref/source/viewmap.cc @@ -698,6 +698,9 @@ bool show_map(level_pos &lpos, bool travel_mode, bool allow_esc, bool allow_offlevel) { bool chose = false; +#ifdef USE_TILE_LOCAL + bool first_run = true; +#endif { levelview_excursion le(travel_mode); level_id original(level_id::current()); @@ -726,8 +729,6 @@ bool show_map(level_pos &lpos, const int num_lines = _get_number_of_lines_levelmap(); const int half_screen = (num_lines - 1) / 2; - const int top = 1 + Options.level_map_title; - int map_lines = 0; // no x scrolling @@ -746,6 +747,7 @@ bool show_map(level_pos &lpos, bool redraw_map = true; #ifndef USE_TILE_LOCAL + const int top = 1 + Options.level_map_title; clrscr(); #endif textcolor(DARKGREY); @@ -861,6 +863,14 @@ bool show_map(level_pos &lpos, // Note: Tile versions just center on the current cursor // location. It silently ignores everything else going // on in this function. --Enne +#ifdef USE_TILE_LOCAL + if(first_run) + { + tiles.update_tabs(); + first_run = false; + } + else +#endif tiles.load_dungeon(lpos.pos); #endif #ifndef USE_TILE_LOCAL @@ -874,15 +884,31 @@ bool show_map(level_pos &lpos, redraw_map = true; c_input_reset(true); +#ifdef USE_TILE_LOCAL + const int key = tiles.getch_ck(); + command_type cmd = key_to_command(key, KMC_LEVELMAP); +#else const int key = unmangle_direction_keys(getchm(KMC_LEVELMAP), KMC_LEVELMAP, false, false); command_type cmd = key_to_command(key, KMC_LEVELMAP); +#endif if (cmd < CMD_MIN_OVERMAP || cmd > CMD_MAX_OVERMAP) cmd = CMD_NO_CMD; if (key == CK_MOUSE_CLICK) { +#ifdef USE_TILE_LOCAL + const coord_def grdp = tiles.get_cursor(); + const coord_def delta = grdp - lpos.pos; + move_y = delta.y; + move_x = delta.x; + + if (move_y == 0 && move_x == 0) // clicked on current position + cmd = CMD_MAP_GOTO_TARGET; // go to current cursor pos + else + cmd = CMD_NEXT_CMD; // a dummy command +#else const c_mouse_event cme = get_mouse_event(); const coord_def grdp = cme.pos + coord_def(start_x - 1, start_y - top); @@ -903,6 +929,7 @@ bool show_map(level_pos &lpos, move_y = delta.y; move_x = delta.x; } +#endif } c_input_reset(false); @@ -1221,6 +1248,11 @@ bool show_map(level_pos &lpos, map_alive = false; break; } + +#ifdef USE_TILE_LOCAL + case CMD_NEXT_CMD: + break; // allow mouse clicks to move cursor without leaving map mode +#endif default: if (travel_mode) { |