3 #include "../item/modalcontroller.qh" 16 me.configureXonoticLanguageList(me);
22 me.configureXonoticListBox(me);
30 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
33 me.focusedItemAlpha =
getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
34 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
38 float alpha_factor = 1;
41 float percent =
stof(p);
44 else if (percent >= 50)
57 vector fs = me.realFontSize;
59 draw_Text(me.realUpperMargin *
eY + me.columnNameOrigin *
eX, s, fs, SKINCOLOR_TEXT * alpha_factor, SKINALPHA_TEXT, 0);
67 vector fs = me.realFontSize;
69 float x_ofs = me.columnPercentageOrigin + (me.columnPercentageSize -
draw_TextWidth(p, 0, fs));
70 draw_Text(me.realUpperMargin *
eY + x_ofs *
eX, p, fs, SKINCOLOR_TEXT, SKINALPHA_TEXT * alpha_factor, 0);
78 me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight);
79 me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth));
80 me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
81 me.columnPercentageSize = me.realFontSize.x * 3;
82 me.columnPercentageOrigin = 1 - me.columnPercentageSize;
83 me.columnNameOrigin = 0;
84 me.columnNameSize = me.columnPercentageOrigin;
101 for(i = 0; i < n; ++i)
103 if(me.languageParameter(me, i,
LANGPARM_ID) ==
"en")
111 for(i = 0; i < n; ++i)
149 buf_del(me.languagelist);
161 while((s =
fgets(fh)))
169 string percent =
argv(3);
170 if(percent && percent !=
"100%")
176 me.languagelist = buf;
185 localcmd(
"\nprvm_language \"$_menu_prvm_language\"; menu_restart; menu_cmd languageselect\n");
void XonoticLanguageList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
void XonoticLanguageList_saveCvars(entity me)
float XonoticLanguageList_keyDown(entity me, float scan, float ascii, float shift)
void XonoticLanguageList_destroy(entity me)
void DialogOpenButton_Click(entity button, entity tab)
const float LANGPARM_COUNT
string XonoticLanguageList_languageParameter(entity me, float i, float key)
void SetLanguage_Click(entity btn, entity me)
const float LANGPARM_NAME_LOCALIZED
const float LANGPARM_NAME
void XonoticLanguageList_getLanguages(entity me)
entity makeXonoticLanguageList()
void XonoticLanguageList_loadCvars(entity me)
void XonoticLanguageList_setLanguage(entity me)
void XonoticLanguageList_doubleClickListBoxItem(entity me, float i, vector where)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void XonoticLanguageList_setSelected(entity me, float i)
void XonoticLanguageList_configureXonoticLanguageList(entity me)
const float LANGPARM_PERCENTAGE
void XonoticLanguageList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)