UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_map_callbacks.cpp File Reference
#include "cl_map_callbacks.h"
#include "../client.h"
#include "cl_game.h"
Include dependency graph for cl_map_callbacks.cpp:

Go to the source code of this file.

Enumerations

enum  ui_gamemode_t {
  GAMEMODE_NONE , GAMEMODE_SKIRMISH , GAMEMODE_MULTIPLAYER , GAMEMODE_CAMPAIGN ,
  MAX_GAMEMODE
}

Functions

static void UI_MapInfoGetNext (int step)
static void UI_MapInfo (int step)
 Prints the map info for the server creation dialogue.
static void UI_GetMaps_f (void)
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_SelectMap_f (void)
static bool UI_MapGameModeCondition (ui_gamemode_t gameMode, const mapDef_t *mapDef)
 Helper function to apply gameMode filter on map definitions.
static void UI_ListMaps_f (void)
 List available maps.
void MAP_InitCallbacks (void)
 Registers UI Callbacks for battlescape map selection.
void MAP_ShutdownCallbacks (void)
 Unregisters UI Callbacks of battlescape map selection.

Variables

static const cmdList_t mapCallbacks []
 List of UI Callbacks of battlescape map selection.

Enumeration Type Documentation

◆ ui_gamemode_t

Enumerator
GAMEMODE_NONE 
GAMEMODE_SKIRMISH 
GAMEMODE_MULTIPLAYER 
GAMEMODE_CAMPAIGN 
MAX_GAMEMODE 

Definition at line 29 of file cl_map_callbacks.cpp.

Function Documentation

◆ MAP_InitCallbacks()

void MAP_InitCallbacks ( void )

Registers UI Callbacks for battlescape map selection.

Definition at line 258 of file cl_map_callbacks.cpp.

References Cmd_TableAddList(), and mapCallbacks.

Referenced by GAME_InitStartup().

◆ MAP_ShutdownCallbacks()

void MAP_ShutdownCallbacks ( void )

Unregisters UI Callbacks of battlescape map selection.

Definition at line 266 of file cl_map_callbacks.cpp.

References Cmd_TableRemoveList(), and mapCallbacks.

Referenced by GAME_Shutdown().

◆ UI_GetMaps_f()

void UI_GetMaps_f ( void )
static

Definition at line 108 of file cl_map_callbacks.cpp.

References UI_MapInfo().

◆ UI_ListMaps_f()

◆ UI_MapGameModeCondition()

bool UI_MapGameModeCondition ( ui_gamemode_t gameMode,
const mapDef_t * mapDef )
inlinestatic

Helper function to apply gameMode filter on map definitions.

Parameters
[in]gameModegame mode constant
[in]mapDefMap definition pointer
Returns
true if the definition is enabled in the specified game mode false otherwise
See also
UI_ListMaps_f

Definition at line 172 of file cl_map_callbacks.cpp.

References mapDef_t::campaign, GAMEMODE_CAMPAIGN, GAMEMODE_MULTIPLAYER, GAMEMODE_SKIRMISH, mapDef_t::multiplayer, and mapDef_t::singleplayer.

Referenced by UI_ListMaps_f().

◆ UI_MapInfo()

void UI_MapInfo ( int step)
static

◆ UI_MapInfoGetNext()

void UI_MapInfoGetNext ( int step)
static

Definition at line 37 of file cl_map_callbacks.cpp.

References cls, Com_GetMapDefByIDX(), csi, FS_CheckFile(), and mapDef_t::mapTheme.

Referenced by UI_MapInfo().

◆ UI_NextMap_f()

void UI_NextMap_f ( void )
static

Select the next available map.

Definition at line 116 of file cl_map_callbacks.cpp.

References UI_MapInfo().

◆ UI_PreviousMap_f()

void UI_PreviousMap_f ( void )
static

Select the previous available map.

Definition at line 124 of file cl_map_callbacks.cpp.

References UI_MapInfo().

◆ UI_SelectMap_f()

void UI_SelectMap_f ( void )
static

Variable Documentation

◆ mapCallbacks

const cmdList_t mapCallbacks[]
static
Initial value:
= {
{"mn_getmaps", UI_GetMaps_f, "The initial map to show"},
{"mn_nextmap", UI_NextMap_f, "Switch to the next valid map for the selected gametype"},
{"mn_prevmap", UI_PreviousMap_f, "Switch to the previous valid map for the selected gametype"},
{"mn_selectmap", UI_SelectMap_f, "Switch to the map given by the parameter - may be invalid for the current gametype"},
{"ui_listmaps", UI_ListMaps_f, "List available maps with some basic information for the UI"},
{nullptr, nullptr, nullptr}
}
static void UI_SelectMap_f(void)
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.
static void UI_GetMaps_f(void)

List of UI Callbacks of battlescape map selection.

Definition at line 242 of file cl_map_callbacks.cpp.

Referenced by MAP_InitCallbacks(), and MAP_ShutdownCallbacks().