29typedef enum ui_gamemode_s {
39 int ref =
cls.currentSelectedMap;
42 cls.currentSelectedMap += step;
43 if (
cls.currentSelectedMap < 0)
44 cls.currentSelectedMap =
csi.numMDs - 1;
45 cls.currentSelectedMap %=
csi.numMDs;
50 if (ref ==
cls.currentSelectedMap)
85 if (mapname[0] ==
'+') {
93 Cvar_Set(
"mn_mappic",
"maps/shots/%s", mapname);
95 Cvar_Set(
"mn_mappic",
"maps/shots/default");
98 Cvar_Set(
"mn_mappic2",
"maps/shots/%s_2", mapname);
100 Cvar_Set(
"mn_mappic2",
"maps/shots/default");
103 Cvar_Set(
"mn_mappic3",
"maps/shots/%s_3", mapname);
105 Cvar_Set(
"mn_mappic3",
"maps/shots/default");
147 cls.currentSelectedMap =
i - 1;
157 cls.currentSelectedMap =
i - 1;
162 Com_Printf(
"Could not find map %s\n", mapname);
174 if (mapDef ==
nullptr)
202 if (
Q_streq(
"skirmish", gameMode))
204 else if (
Q_streq(
"multiplayer", gameMode))
206 else if (
Q_streq(
"campaign", gameMode))
244 {
"mn_getmaps",
UI_GetMaps_f,
"The initial map to show"},
246 {
"mn_nextmap",
UI_NextMap_f,
"Switch to the next valid map for the selected gametype"},
247 {
"mn_prevmap",
UI_PreviousMap_f,
"Switch to the previous valid map for the selected gametype"},
248 {
"mn_selectmap",
UI_SelectMap_f,
"Switch to the map given by the parameter - may be invalid for the current gametype"},
250 {
"ui_listmaps",
UI_ListMaps_f,
"List available maps with some basic information for the UI"},
252 {
nullptr,
nullptr,
nullptr}
Shared game type headers.
mapDef_t * Com_GetMapDefByIDX(int index)
static void UI_MapInfo(int step)
Prints the map info for the server creation dialogue.
static void UI_SelectMap_f(void)
static void UI_MapInfoGetNext(int step)
static bool UI_MapGameModeCondition(ui_gamemode_t gameMode, const mapDef_t *mapDef)
Helper function to apply gameMode filter on map definitions.
static const cmdList_t mapCallbacks[]
List of UI Callbacks of battlescape map selection.
static void UI_NextMap_f(void)
Select the next available map.
static void UI_PreviousMap_f(void)
Select the previous available map.
static void UI_ListMaps_f(void)
List available maps.
void MAP_ShutdownCallbacks(void)
Unregisters UI Callbacks of battlescape map selection.
static void UI_GetMaps_f(void)
void MAP_InitCallbacks(void)
Registers UI Callbacks for battlescape map selection.
Primary header for client.
const char * Cmd_Argv(int arg)
Returns a given argument.
void Cmd_TableAddList(const cmdList_t *cmdList)
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
void Cmd_TableRemoveList(const cmdList_t *cmdList)
void Com_Printf(const char *const fmt,...)
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
void * LIST_GetRandom(linkedList_t *list)
#define MapDef_ForeachCondition(var, condition)
#define MapDef_Foreach(var)
bool R_ImageExists(const char *pname,...)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
const mapDef_t *EXPORT * MapInfo(int step)
void UI_ExecuteConfunc(const char *fmt,...)
Executes confunc - just to identify those confuncs in the code - in this frame.