19 me.configureXonoticMapList(me);
25 me.stringFilterBox = e;
31 me.configureXonoticListBox(me);
47 string a, b, c, s, bspname;
49 s = me.g_maplistCache;
72 for(i = 0; i < n; ++i)
73 if(
argv(i) != bspname)
82 me.startButton.disabled = ((me.selectedItem < 0) || (me.selectedItem >= me.nItems));
88 me.itemAbsSize =
'0 0 0';
91 me.itemAbsSize.y = absSize.y * me.itemHeight;
92 me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
93 me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
94 me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
95 me.realUpperMargin1 = 0.5 * (1 - 2.5 * me.realFontSize.y);
96 me.realUpperMargin2 = me.realUpperMargin1 + 1.5 * me.realFontSize.y;
98 me.columnPreviewOrigin = 0;
99 me.columnPreviewSize = me.itemAbsSize.y / me.itemAbsSize.x * 4 / 3;
100 me.columnNameOrigin = me.columnPreviewOrigin + me.columnPreviewSize + me.realFontSize.x;
101 me.columnNameSize = 1 - me.columnPreviewSize - 2 * me.realFontSize.x;
103 me.checkMarkSize = (
eX * (me.itemAbsSize.y / me.itemAbsSize.x) +
eY) * 0.5;
104 me.checkMarkOrigin =
eY +
eX * (me.columnPreviewOrigin + me.columnPreviewSize) - me.checkMarkSize;
109 if(where.x <= me.columnPreviewOrigin + me.columnPreviewSize)
113 me.g_maplistCacheToggle(me, i);
119 if(where.x >= me.columnNameOrigin)
124 main.mapInfoDialog.loadMapInfo(
main.mapInfoDialog, i, me);
139 included = me.g_maplistCacheQuery(me, i);
140 if(included || isSelected)
141 theAlpha = SKINALPHA_MAPLIST_INCLUDEDFG;
143 theAlpha = SKINALPHA_MAPLIST_NOTINCLUDEDFG;
146 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
150 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_MAPLIST_INCLUDEDBG, SKINALPHA_MAPLIST_INCLUDEDBG);
153 me.focusedItemAlpha =
getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
154 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
159 draw_Picture(me.columnPreviewOrigin *
eX,
"nopreview_map", me.columnPreviewSize *
eX +
eY,
'1 1 1', theAlpha);
164 draw_Picture(me.checkMarkOrigin,
"checkmark", me.checkMarkSize,
'1 1 1', 1);
166 draw_Text(me.realUpperMargin1 *
eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize -
draw_TextWidth(s, 0, me.realFontSize))) *
eX, s, me.realFontSize, SKINCOLOR_MAPLIST_TITLE, theAlpha, 0);
168 draw_Text(me.realUpperMargin2 *
eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize -
draw_TextWidth(s, 0, me.realFontSize))) *
eX, s, me.realFontSize, SKINCOLOR_MAPLIST_AUTHOR, theAlpha, 0);
190 for(i = 0; i < n; ++i)
204 strcpy(me.g_maplistCache, s);
205 if(gt != me.lastGametype || f != me.lastFeatures)
207 me.lastGametype = gt;
209 me.setSelected(me, 0);
222 me.stringFilter =
strzone(box.text);
230 n =
strlen(me.g_maplistCache);
231 for (i = 0 ; i < n; i++)
233 if (!me.g_maplistCacheQuery(me, i))
234 me.g_maplistCacheToggle(me, i);
242 n =
strlen(me.g_maplistCache);
243 for (i = 0 ; i < n; i++)
245 if (me.g_maplistCacheQuery(me, i))
246 me.g_maplistCacheToggle(me, i);
276 if(btn.parent.instanceOfXonoticMapInfoDialog)
278 i = btn.parent.currentMapIndex;
282 if(i >= me.nItems || i < 0)
288 LOG_INFO(_(
"Huh? Can't play this (m is NULL). Refiltering so this won't happen again."));
294 localcmd(
"\nmenu_loadmap_prepare\n");
295 if(
cvar(
"menu_use_default_hostname"))
296 localcmd(
"hostname \"", sprintf(_(
"%s's Xonotic Server"), strdecolorize(
cvar_string(
"_cl_name"))),
"\"\n");
301 LOG_INFO(_(
"Huh? Can't play this (invalid game type). Refiltering so this won't happen again."));
316 main.mapInfoDialog.loadMapInfo(
main.mapInfoDialog, me.selectedItem, me);
317 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));
322 me.g_maplistCacheToggle(me, me.selectedItem);
326 if (!me.g_maplistCacheQuery(me, me.selectedItem))
329 me.g_maplistCacheToggle(me, me.selectedItem);
334 if(me.g_maplistCacheQuery(me, me.selectedItem))
337 me.g_maplistCacheToggle(me, me.selectedItem);
342 if(
time < me.typeToSearchTime)
344 save =
substring(me.typeToSearchString, 0,
strlen(me.typeToSearchString) - 1);
345 strcpy(me.typeToSearchString, save);
346 me.typeToSearchTime =
time + 0.5;
347 if(
strlen(me.typeToSearchString))
355 else if(ascii >= 32 && ascii != 127)
358 if(
time > me.typeToSearchTime)
361 save =
strcat(me.typeToSearchString, ch);
362 strcpy(me.typeToSearchString, save);
363 me.typeToSearchTime =
time + 0.5;
368 else if((shift &
S_CTRL) && scan ==
'f')
370 me.parent.setFocus(me.parent, me.stringFilterBox);
372 else if((shift & S_CTRL) && scan ==
'u')
374 me.stringFilterBox.setText(me.stringFilterBox,
"");
391 me.onChangeEntity.parent.setFocus(me.onChangeEntity.parent, me.onChangeEntity);
398 return me.onChangeEntity.keyDown(me.onChangeEntity, scan, ascii, shift);
int MapInfo_RequiredFlags()
void XonoticMapList_doubleClickListBoxItem(entity me, float i, vector where)
float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift)
void MapList_Remove_All(entity btn, entity me)
entity MapList_Set_String_Filter_Box(entity me, entity e)
float MapList_StringFilterBox_keyDown(entity me, float scan, float ascii, float shift)
void XonoticMapList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
void MapList_StringFilterBox_Change(entity box, entity me)
void MapList_Remove_Shown(entity btn, entity me)
void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize)
bool MapInfo_Get_ByID(int i)
void XonoticMapList_refilter(entity me)
int MapInfo_ForbiddenFlags()
void MapList_Add_Shown(entity btn, entity me)
void XonoticMapList_refilterCallback(entity me, entity cb)
void MapList_LoadMap(entity btn, entity me)
string MapInfo_Map_author
void XonoticMapList_g_maplistCacheToggle(entity me, float i)
Gametype MapInfo_CurrentGametype()
int MapInfo_CurrentFeatures()
void XonoticMapList_draw(entity me)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void XonoticMapList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
float MapInfo_CheckMap(string s)
void XonoticMapList_loadCvars(entity me)
void MapInfo_ClearTemps()
void XonoticMapList_clickListBoxItem(entity me, float i, vector where)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float MapInfo_FindName_firstResult
float MapInfo_FindName(string s)
string MapInfo_Map_bspname
void MapInfo_FilterString(string sf)
void XonoticMapList_destroy(entity me)
void XonoticMapList_configureXonoticMapList(entity me)
float XonoticMapList_g_maplistCacheQuery(entity me, float i)
float _MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
void MapInfo_LoadMap(string s, float reinit)
float MapInfo_FilterGametype(Gametype pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
entity makeXonoticMapList()
string MapInfo_BSPName_ByID(float i)
void MapList_Add_All(entity btn, entity me)
string MapInfo_Map_titlestring