Jump to content

Photo

Android: Highlighting containers in BG2

android gemrb baldurs gate 2 highlighting

9 replies to this topic

#1 Baldurer

Baldurer
  • Members
  • 5 posts

Posted 13 January 2012 - 06:57 AM

Is it supposed to be possible to highlight all containers like in the original BG2 (by pressing tab)? Am I just not using the right key (tried alt and tab), or is it a bug or missing feature?

#2 Avenger

Avenger
  • Modders
  • 3805 posts
  • Gender:Male
  • Location:Hungary

Posted 13 January 2012 - 07:52 AM

It is linked to the 'Alt' key. But you have to keep it pressed to see the highlights.
The 'Tab' key shows hp overhead.
Later we'll make these configurable.

#3 Baldurer

Baldurer
  • Members
  • 5 posts

Posted 13 January 2012 - 09:05 AM

OK, I have tried mapping both ralt and lalt to an onscreen button, but neither of them do the highlighting.
When I hold alt however, a character is centered on the screen
Is this just me?

#4 illcrystals

illcrystals
  • Members
  • 7 posts

Posted 15 January 2012 - 10:54 AM

Mapping ALT to a key definitely does not work, even though that's what it should be in the game. Here's some information that might be helpful:

I have an Xperia Play, so I have extra hardware buttons to map. When I first loaded up BG2 on GemRB to make sure everything was running fine, before I remapped all the keys, I could highlight all containers by pressing the 'X' button on my phone's gamepad.

So I think that whatever was default mapped to the 'X' key on my gamepad would be the value corresponding to 'highlight all containers' in BG2.

Do any of you devs know what value would be mapped to the 'X' button on an Xperia Play gamepad for GemRB by default?

#5 Baldurer

Baldurer
  • Members
  • 5 posts

Posted 15 January 2012 - 01:34 PM

Illcrystals, thanks a lot! That helped me solve it. The key that highlights containers on android is appearently the c key.
I found this document:
http://developer.son...play-game-keys/
and saw that the key code value for the x button on xperia play is 99.
" 99 KEYCODE_BUTTON_X Function is game specific.
"
I then looked up the source code for the sdl port that is used by gemrb to access hardware. The file in that repo
called KeyCodes.java contains the keycodes which are mapped to different keys. From there, I could see which key was
mapped to the keycode 99 in version 1.2 which is used on my version of android.
"public static final int SDLK_c = 99;"
The source code for the file is located here:
https://github.com/p...a/Keycodes.java

Now I can finally enjoy the game again =)

#6 Avenger

Avenger
  • Modders
  • 3805 posts
  • Gender:Male
  • Location:Hungary

Posted 15 January 2012 - 02:07 PM

Hehe, actually, in GemRB's code, i can read this:
			   case GEM_ALT: //alt key (shows containers)
#ifdef ANDROID
			    case 'c': // show containers in ANDROID, GEM_ALT is not possible to use
#endif
					    DebugFlags &= ~DEBUG_SHOW_CONTAINERS;
					    break;


#7 Baldurer

Baldurer
  • Members
  • 5 posts

Posted 15 January 2012 - 11:47 PM

Well that explains it =)
Might be a good idea to add the keys to the app description on android market?

#8 SyntaxError

SyntaxError
  • Modders
  • 932 posts
  • Gender:Male

Posted 16 January 2012 - 03:18 PM

this raises the question: if android has alt keys but GEM_ALT doesnt work why not have an #ifdef ANDROID assign the correct value to GEM_ALT for androids alt key instead of changing the key?

Edited by SyntaxError, 16 January 2012 - 03:18 PM.


#9 Avenger

Avenger
  • Modders
  • 3805 posts
  • Gender:Male
  • Location:Hungary

Posted 17 January 2012 - 04:39 AM

Probably not all Android are the same, but still, on those that have an alt key, it should be associated with GEM_ALT.

#10 Beholder

Beholder
  • Members
  • 329 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 20 January 2012 - 06:37 AM

Highlighting hotkey is mapped to physical 'Search' key as default. But some devices does not have this key (s.a. Samsung phones and tablets). You may remap 'c' hotkey for these devices in SDL menu.

Edited by Beholder, 20 January 2012 - 06:39 AM.




Reply to this topic



  



Also tagged with one or more of these keywords: android, gemrb, baldurs gate 2, highlighting

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users