X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcredits.c;h=daf4d22f9c8dd95b221fdaf7c4134b628c4ccfc2;hb=9e6f5676f0a85fee3c1650a17786824a522d518a;hp=5c2f1585c462479d2c47486599456d36beb09511;hpb=6d81ab64afd3d9980ff963edb261c03554fdfddb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/credits.c b/qcsrc/menu/xonotic/credits.c index 5c2f1585c..daf4d22f9 100644 --- a/qcsrc/menu/xonotic/credits.c +++ b/qcsrc/menu/xonotic/credits.c @@ -30,7 +30,9 @@ void XonoticCreditsList_configureXonoticCreditsList(entity me) { me.configureXonoticListBox(me); // load the file - me.bufferIndex = buf_load("xonotic-credits.txt"); + me.bufferIndex = buf_load(language_filename("xonotic-credits.txt")); + if(me.bufferIndex < 0) + me.bufferIndex = buf_load("xonotic-credits.txt"); me.nItems = buf_getsize(me.bufferIndex); } void XonoticCreditsList_destroy(entity me) @@ -87,22 +89,21 @@ void XonoticCreditsList_drawListBoxItem(entity me, float i, vector absSize, floa draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, s, me.realFontSize, theColor, theAlpha, 0); } -float XonoticCreditsList_keyDown(entity me, float scan, float ascii, float shift) +float XonoticCreditsList_keyDown(entity me, float key, float ascii, float shift) { float i; me.dragScrollTimer = time; me.scrolling = 0; - - if(scan == K_PGUP) + if(key == K_PGUP || key == K_KP_PGUP) me.scrollPos = max(me.scrollPos - 0.5, 0); - else if(scan == K_PGDN) + else if(key == K_PGDN || key == K_KP_PGDN) me.scrollPos = min(me.scrollPos + 0.5, me.nItems * me.itemHeight - 1); - else if(scan == K_UPARROW) + else if(key == K_UPARROW || key == K_KP_UPARROW) me.scrollPos = max(me.scrollPos - me.itemHeight, 0); - else if(scan == K_DOWNARROW) + else if(key == K_DOWNARROW || key == K_KP_DOWNARROW) me.scrollPos = min(me.scrollPos + me.itemHeight, me.nItems * me.itemHeight - 1); else - return SUPER(XonoticCreditsList).keyDown(me, scan, ascii, shift); + return SUPER(XonoticCreditsList).keyDown(me, key, ascii, shift); i = min(me.selectedItem, floor((me.scrollPos + 1) / me.itemHeight - 1)); i = max(i, ceil(me.scrollPos / me.itemHeight));