From: Severin Meyer Date: Fri, 10 Oct 2014 18:13:26 +0000 (+0200) Subject: Make the maplist use the same input controls as the serverlist: RMB/space = info... X-Git-Tag: xonotic-v0.8.0~147^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=21c8b6a17402d1adc7dfdf5712522c280530364d;p=xonotic%2Fxonotic-data.pk3dir.git Make the maplist use the same input controls as the serverlist: RMB/space = info dialog, MMB/ins = toggle item --- diff --git a/qcsrc/menu/xonotic/maplist.c b/qcsrc/menu/xonotic/maplist.c index ce937e4ad..eacfb42e7 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -142,25 +142,8 @@ void XonoticMapList_resizeNotify(entity me, vector relOrigin, vector relSize, ve void XonoticMapList_clickListBoxItem(entity me, float i, vector where) { if(where_x <= me.columnPreviewOrigin + me.columnPreviewSize) - { if(where_x >= 0) me.g_maplistCacheToggle(me, i); - } - if(where_x >= me.columnNameOrigin) - if(where_x <= 1) - { - if(i == me.lastClickedMap) - if(time < me.lastClickedTime + 0.3) - { - // DOUBLE CLICK! - // pop up map info screen - main.mapInfoDialog.loadMapInfo(main.mapInfoDialog, i, me); - DialogOpenButton_Click_withCoords(NULL, main.mapInfoDialog, me.origin + eX * (me.columnNameOrigin * me.size_x) + eY * ((me.itemHeight * i - me.scrollPos) * me.size_y), eY * me.itemAbsSize_y + eX * (me.itemAbsSize_x * me.columnNameSize)); - return; - } - me.lastClickedMap = i; - me.lastClickedTime = time; - } } void XonoticMapList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) @@ -301,13 +284,13 @@ float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) string ch, save; if(me.nItems <= 0) return SUPER(XonoticMapList).keyDown(me, scan, ascii, shift); - if(scan == K_ENTER || scan == K_KP_ENTER) + if(scan == K_MOUSE2 || scan == K_SPACE) { // pop up map info screen main.mapInfoDialog.loadMapInfo(main.mapInfoDialog, me.selectedItem, me); DialogOpenButton_Click_withCoords(NULL, main.mapInfoDialog, me.origin + eX * (me.columnNameOrigin * me.size_x) + eY * ((me.itemHeight * me.selectedItem - me.scrollPos) * me.size_y), eY * me.itemAbsSize_y + eX * (me.itemAbsSize_x * me.columnNameSize)); } - else if(scan == K_SPACE) + else if(scan == K_MOUSE3 || scan == K_INS || scan == K_KP_INS) { me.g_maplistCacheToggle(me, me.selectedItem); }