diff options
author | Tim Angus <tim@ngus.net> | 2004-03-19 05:14:11 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-03-19 05:14:11 +0000 |
commit | 5c1b09501fc350415b3f1c028af38e635347782c (patch) | |
tree | 01b1522b747202ddac2beffd17fca62f0bc073d0 /src/ui | |
parent | 1eee6be0ea1aeec679cff80fea36a91e6d0c788f (diff) |
* Fixed TA listbox bug where user could select beyond the length of the list
* Hitting K_ENTER when a listbox has focus now invokes its doubleClick handler
* You can't use objects when dead any longer
* Team change broadcast message fixed
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_shared.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index d4bc9ace..77e6c5f5 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -1866,6 +1866,16 @@ qboolean Item_ListBox_HandleKey(itemDef_t *item, int key, qboolean down, qboolea } return qtrue; } + + //TA: invoke the doubleClick handler when enter is pressed + if( key == K_ENTER ) + { + if( listPtr->doubleClick ) + Item_RunScript( item, listPtr->doubleClick ); + + return qtrue; + } + if ( key == K_HOME || key == K_KP_HOME) { // home listPtr->startPos = 0; @@ -3400,6 +3410,7 @@ static bind_t g_bindings[] = { "+attack", K_MOUSE1, -1, -1, -1 }, { "+button5", K_MOUSE2, -1, -1, -1 }, //TA: secondary attack { "reload", 'r', -1, -1, -1 }, //TA: reload + { "buy ammo", 'b', -1, -1, -1 }, //TA: buy ammo { "+button7", 'q', -1, -1, -1 }, //TA: buildable use { "deconstruct", 'e', -1, -1, -1 }, //TA: buildable destroy { "weapprev", '[', -1, -1, -1 }, @@ -3892,7 +3903,8 @@ void Item_Image_Paint(itemDef_t *item) { } void Item_ListBox_Paint(itemDef_t *item) { - float x, y, size, count, i, thumb; + float x, y, size, thumb; + int i, count; qhandle_t image; qhandle_t optionalImage; listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; @@ -4066,6 +4078,9 @@ void Item_ListBox_Paint(itemDef_t *item) { } } } + + //TA: fix to off-by-one bug + listPtr->endPos--; } |