X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Flanguagelist.qc;h=9d217fc514e463a5a6566889f287dde15f9c5c53;hp=d34062d465d451770a5f66fdf0ecf65cb942d67b;hb=20387ff9f8cef7536362de05c76cc0062416a64c;hpb=d99a102842ced06e6e1a0c9358c07c3b64523968 diff --git a/qcsrc/menu/xonotic/languagelist.qc b/qcsrc/menu/xonotic/languagelist.qc index d34062d465..9d217fc514 100644 --- a/qcsrc/menu/xonotic/languagelist.qc +++ b/qcsrc/menu/xonotic/languagelist.qc @@ -2,7 +2,7 @@ CLASS(XonoticLanguageList) EXTENDS(XonoticListBox) METHOD(XonoticLanguageList, configureXonoticLanguageList, void(entity)) ATTRIB(XonoticLanguageList, rowsPerItem, float, 1) - METHOD(XonoticLanguageList, drawListBoxItem, void(entity, float, vector, float)) + METHOD(XonoticLanguageList, drawListBoxItem, void(entity, int, vector, bool, float)) METHOD(XonoticLanguageList, resizeNotify, void(entity, vector, vector, vector, vector)) METHOD(XonoticLanguageList, setSelected, void(entity, float)) METHOD(XonoticLanguageList, loadCvars, void(entity)) @@ -55,19 +55,21 @@ void XonoticLanguageList_configureXonoticLanguageList(entity me) me.loadCvars(me); } -void XonoticLanguageList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) +void XonoticLanguageList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, float highlightedTime) { string s, p; if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); + else if(highlightedTime) + draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime)); s = me.languageParameter(me, i, LANGPARM_NAME_LOCALIZED); vector save_fontscale = draw_fontscale; - float f = draw_CondensedFontFactor(s, FALSE, me.realFontSize, 1); - draw_fontscale_x *= f; + float f = draw_CondensedFontFactor(s, false, me.realFontSize, 1); + draw_fontscale.x *= f; vector fs = me.realFontSize; - fs_x *= f; + fs.x *= f; draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, fs, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); draw_fontscale = save_fontscale; @@ -75,10 +77,10 @@ void XonoticLanguageList_drawListBoxItem(entity me, float i, vector absSize, flo if(p != "") { vector save_fontscale = draw_fontscale; - float f = draw_CondensedFontFactor(p, FALSE, me.realFontSize, 1); - draw_fontscale_x *= f; + float f = draw_CondensedFontFactor(p, false, me.realFontSize, 1); + draw_fontscale.x *= f; vector fs = me.realFontSize; - fs_x *= f; + fs.x *= f; draw_Text(me.realUpperMargin * eY + (me.columnPercentageOrigin + (me.columnPercentageSize - draw_TextWidth(p, 0, fs))) * eX, p, fs, SKINCOLOR_TEXT, SKINALPHA_TEXT, 0); draw_fontscale = save_fontscale; } @@ -87,10 +89,10 @@ void XonoticLanguageList_drawListBoxItem(entity me, float i, vector absSize, flo void XonoticLanguageList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { SUPER(XonoticLanguageList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); - me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight); - me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth)); - me.realUpperMargin = 0.5 * (1 - me.realFontSize_y); - me.columnPercentageSize = me.realFontSize_x * 3; + me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight); + me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth)); + me.realUpperMargin = 0.5 * (1 - me.realFontSize.y); + me.columnPercentageSize = me.realFontSize.x * 3; me.columnPercentageOrigin = 1 - me.columnPercentageSize; me.columnNameOrigin = 0; me.columnNameSize = me.columnPercentageOrigin; @@ -140,12 +142,15 @@ void XonoticLanguageList_saveCvars(entity me) void XonoticLanguageList_doubleClickListBoxItem(entity me, float i, vector where) { + m_play_click_sound(MENU_SOUND_EXECUTE); me.setLanguage(me); } float XonoticLanguageList_keyDown(entity me, float scan, float ascii, float shift) { - if(scan == K_ENTER || scan == K_KP_ENTER) { + if(scan == K_ENTER || scan == K_KP_ENTER) + { + m_play_click_sound(MENU_SOUND_EXECUTE); me.setLanguage(me); return 1; }