26 #include "../client.h" 77 if (mapname[0] ==
'+') {
85 Cvar_Set(
"mn_mappic",
"maps/shots/%s", mapname);
87 Cvar_Set(
"mn_mappic",
"maps/shots/default");
90 Cvar_Set(
"mn_mappic2",
"maps/shots/%s_2", mapname);
92 Cvar_Set(
"mn_mappic2",
"maps/shots/default");
95 Cvar_Set(
"mn_mappic3",
"maps/shots/%s_3", mapname);
97 Cvar_Set(
"mn_mappic3",
"maps/shots/default");
154 Com_Printf(
"Could not find map %s\n", mapname);
167 const char* callbackCmd =
Cmd_Argv(1);
187 if (preview[0] ==
'+')
192 Cbuf_AddText(
"%s add \"%s\" \"%s\"\n", callbackCmd, md->
id, preview);
202 {
"mn_getmaps",
UI_GetMaps_f,
"The initial map to show"},
203 {
"mn_nextmap",
UI_NextMap_f,
"Switch to the next valid map for the selected gametype"},
204 {
"mn_prevmap",
UI_PreviousMap_f,
"Switch to the previous valid map for the selected gametype"},
205 {
"mn_selectmap",
UI_SelectMap_f,
"Switch to the map given by the parameter - may be invalid for the current gametype"},
206 {
"mn_requestmaplist",
UI_RequestMapList_f,
"Request to send the list of available maps for the current gametype to a command."},
208 {
nullptr,
nullptr,
nullptr}
const char * Cmd_Argv(int arg)
Returns a given argument.
static void UI_MapInfo(int step)
Prints the map info for the server creation dialogue.
static void UI_SelectMap_f(void)
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
void MAP_InitCallbacks(void)
Registers UI Callbacks for battlescape map selection.
static void UI_NextMap_f(void)
Select the next available map.
static void UI_GetMaps_f(void)
const struct cgame_export_s * gametype
void Cbuf_AddText(const char *format,...)
Adds command text at the end of the buffer.
Shared game type headers.
void Com_Printf(const char *const fmt,...)
const mapDef_t *EXPORT * MapInfo(int step)
void Cmd_TableRemoveList(const cmdList_t *cmdList)
#define MapDef_ForeachCondition(var, condition)
mapDef_t * Com_GetMapDefByIDX(int index)
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
bool GAME_IsMultiplayer(void)
static const cmdList_t mapCallbacks[]
List of UI Callbacks of battlescape map selection.
static void UI_RequestMapList_f(void)
#define MapDef_Foreach(var)
static void UI_MapInfoGetNext(int step)
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
void MAP_ShutdownCallbacks(void)
Unregisters UI Callbacks of battlescape map selection.
static void UI_PreviousMap_f(void)
Select the previous available map.
void * LIST_GetRandom(linkedList_t *list)
bool R_ImageExists(const char *pname,...)
void Cmd_TableAddList(const cmdList_t *cmdList)