Manage popups. More...
#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "../ui/ui_popup.h"
#include "cp_campaign.h"
#include "cp_mapfightequip.h"
#include "cp_map.h"
#include "cp_popup.h"
#include "cp_missions.h"
#include "cp_time.h"
#include "cp_aircraft_callbacks.h"
Go to the source code of this file.
Data Structures | |
struct | popup_aircraft_s |
Structure to store information about popup_aircraft. More... | |
struct | popup_intercept_s |
Defines | |
#define | POPUP_AIRCRAFT_MAX_ITEMS 10 |
#define | POPUP_AIRCRAFT_MAX_TEXT 2048 |
#define | POPUP_INTERCEPT_MAX_AIRCRAFT 64 |
Typedefs | |
typedef struct popup_aircraft_s | popup_aircraft_t |
Structure to store information about popup_aircraft. | |
typedef struct popup_intercept_s | popup_intercept_t |
Enumerations | |
enum | popup_aircraft_action_e { POPUP_AIRCRAFT_ACTION_BACKTOBASE = 1, POPUP_AIRCRAFT_ACTION_STOP = 2, POPUP_AIRCRAFT_ACTION_MOVETOMISSION = 3, POPUP_AIRCRAFT_CHANGE_HOMEBASE = 4, POPUP_AIRCRAFT_ACTION_NONE, POPUP_AIRCRAFT_ACTION_MAX } |
Enumerate type of actions available for popup_aircraft. More... | |
Functions | |
qboolean | CL_DisplayHomebasePopup (aircraft_t *aircraft, qboolean alwaysDisplay) |
Display the popup_homebase. | |
static void | CL_PopupChangeHomebase_f (void) |
User select a base in the popup_homebase change homebase to selected base. | |
void | CL_DisplayPopupAircraft (aircraft_t *aircraft) |
Display the popup_aircraft. | |
static void | CL_PopupAircraftClick_f (void) |
User just select an item in the popup_aircraft. | |
void | CL_DisplayPopupInterceptMission (mission_t *mission) |
Display the popup_mission. | |
void | CL_DisplayPopupInterceptUFO (aircraft_t *ufo) |
Display the popup_intercept. | |
static aircraft_t * | CL_PopupInterceptGetAircraft_f (void) |
return the selected aircraft in popup_intercept Close the popup if required | |
static void | CL_PopupInterceptClick_f (void) |
User select an item in the popup_aircraft Make the aircraft attack the corresponding mission or UFO. | |
static void | CL_PopupInterceptRClick_f (void) |
User select an item in the popup_aircraft with right click Opens up the aircraft menu. | |
static void | CL_PopupInterceptBaseClick_f (void) |
User select a base in the popup_aircraft Make the base attack the corresponding UFO. | |
void | CL_PopupInit (void) |
Initialise popups. | |
void | CP_PopupList (const char *title, const char *text) |
Wrapper around UI_Popup which also stops the time. | |
Variables | |
static popup_aircraft_t | popupAircraft |
static popup_intercept_t | popupIntercept |
static int | popupNum |
static linkedList_t * | popupListData = NULL |
static uiNode_t * | popupListNode = NULL |
static int | INVALID_BASE = -1 |
Manage popups.
Definition in file cp_popup.c.
#define POPUP_AIRCRAFT_MAX_ITEMS 10 |
Max items displayed in popup_aircraft
Definition at line 40 of file cp_popup.c.
#define POPUP_AIRCRAFT_MAX_TEXT 2048 |
Max size of text displayed in popup_aircraft
Definition at line 42 of file cp_popup.c.
Referenced by CL_DisplayPopupAircraft().
#define POPUP_INTERCEPT_MAX_AIRCRAFT 64 |
Max aircraft in popup list
Definition at line 75 of file cp_popup.c.
Referenced by CL_DisplayPopupInterceptMission(), and CL_DisplayPopupInterceptUFO().
typedef struct popup_aircraft_s popup_aircraft_t |
Structure to store information about popup_aircraft.
typedef struct popup_intercept_s popup_intercept_t |
Enumerate type of actions available for popup_aircraft.
Definition at line 47 of file cp_popup.c.
qboolean CL_DisplayHomebasePopup | ( | aircraft_t * | aircraft, | |
qboolean | alwaysDisplay | |||
) |
Display the popup_homebase.
[in] | aircraft | Pointer to aircraft we want to change homebase. |
[in] | alwaysDisplay | False if popup should be displayed only if at least one base is available. |
< Set color for selected entry.
Definition at line 103 of file cp_popup.c.
References _, AIR_CheckMoveIntoNewHomebase(), AIR_GetCapacityByAircraftWeight(), B_GetFoundedBaseByIDX(), byte, CL_GameTimeStop(), Com_sprintf(), aircraft_s::homebase, INVALID_BASE, LIST_Add(), LIST_AddString(), LIST_Delete(), MAP_SelectAircraft(), MAX_BASES, MAX_VAR, base_s::name, popupNum, qfalse, qtrue, uiNode_s::selectedColor, UI_PopupList(), UI_TextNodeSelectLine(), and VectorSet.
Referenced by B_RemoveAircraftExceedingCapacity(), CL_PopupAircraftClick_f(), and CL_PopupChangeHomebase_f().
void CL_DisplayPopupAircraft | ( | aircraft_t * | aircraft | ) |
Display the popup_aircraft.
Definition at line 216 of file cp_popup.c.
References _, AIR_GetTeamSize(), popup_aircraft_s::aircraft, ccs, CP_MissionToTypeString(), linkedList_s::data, aircraft_s::homebase, popup_aircraft_s::itemsAction, popup_aircraft_s::itemsId, lengthof, mission_s::location, MAP_GetIDXByMission(), ccs_s::missions, base_s::name, linkedList_s::next, popup_aircraft_s::numItems, mission_s::onGeoscape, POPUP_AIRCRAFT_ACTION_BACKTOBASE, POPUP_AIRCRAFT_ACTION_MOVETOMISSION, POPUP_AIRCRAFT_ACTION_STOP, POPUP_AIRCRAFT_CHANGE_HOMEBASE, POPUP_AIRCRAFT_MAX_TEXT, mission_s::pos, Q_strcat(), mission_s::stage, STAGE_NOT_ACTIVE, TEXT_POPUP, popup_aircraft_s::textPopup, UI_PushWindow(), UI_RegisterText(), and va().
Referenced by MAP_MultiSelectExecuteAction_f().
void CL_DisplayPopupInterceptMission | ( | mission_t * | mission | ) |
Display the popup_mission.
Definition at line 312 of file cp_popup.c.
References _, AIR_AircraftStatusToName(), AIR_CanIntercept(), AIR_GetNextFromBase(), AIR_GetTeamSize(), AIR_STATS_SPEED, popup_intercept_s::aircraft, B_GetFoundedBaseByIDX(), ccs, CL_GameTimeStop(), CL_SecondConvert(), Com_sprintf(), GetDistanceOnGlobe(), aircraft_s::homebase, LIST_AddString(), aircraft_s::maxTeamSize, popup_intercept_s::mission, base_s::name, aircraft_s::name, popup_intercept_s::numAircraft, ccs_s::numBases, POPUP_INTERCEPT_MAX_AIRCRAFT, mission_s::pos, aircraft_s::pos, SECONDS_PER_HOUR, aircraft_s::stats, TEXT_AIRCRAFT_LIST, popup_intercept_s::ufo, UI_PushWindow(), UI_RegisterLinkedListText(), and UI_RegisterText().
Referenced by MAP_MultiSelectExecuteAction_f().
void CL_DisplayPopupInterceptUFO | ( | aircraft_t * | ufo | ) |
Display the popup_intercept.
Definition at line 374 of file cp_popup.c.
References _, AII_BaseCanShoot(), AII_InstallationCanShoot(), AIR_AircraftHasEnoughFuel(), AIR_AircraftStatusToName(), AIR_CanIntercept(), AIR_GetNextFromBase(), AIR_GetTeamSize(), popup_intercept_s::aircraft, AIRFIGHT_ChooseWeapon(), AIRFIGHT_WEAPON_CAN_NEVER_SHOOT, B_GetFoundedBaseByIDX(), ccs, CL_GameTimeStop(), Com_DPrintf(), Com_sprintf(), DEBUG_CLIENT, aircraft_s::homebase, aircraft_s::id, INS_GetFoundedInstallationByIDX(), LIST_AddString(), aircraft_s::maxTeamSize, aircraft_s::maxWeapons, popup_intercept_s::mission, installation_s::name, aircraft_s::name, base_s::name, popup_intercept_s::numAircraft, ccs_s::numBases, ccs_s::numInstallations, POPUP_INTERCEPT_MAX_AIRCRAFT, aircraft_s::pos, TEXT_AIRCRAFT_LIST, TEXT_BASE_LIST, popup_intercept_s::ufo, UI_PushWindow(), UI_RegisterLinkedListText(), UI_RegisterText(), va(), and aircraft_s::weapons.
Referenced by MAP_MultiSelectExecuteAction_f().
static void CL_PopupAircraftClick_f | ( | void | ) | [static] |
User just select an item in the popup_aircraft.
Definition at line 258 of file cp_popup.c.
References AIR_AircraftReturnToBase(), AIR_IDLE, AIR_SendAircraftToMission(), popup_aircraft_s::aircraft, CL_DisplayHomebasePopup(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, popup_aircraft_s::itemsAction, popup_aircraft_s::itemsId, MAP_GetMissionByIDX(), popup_aircraft_s::numItems, POPUP_AIRCRAFT_ACTION_BACKTOBASE, POPUP_AIRCRAFT_ACTION_MOVETOMISSION, POPUP_AIRCRAFT_ACTION_NONE, POPUP_AIRCRAFT_ACTION_STOP, POPUP_AIRCRAFT_CHANGE_HOMEBASE, qfalse, qtrue, aircraft_s::status, and UI_PopWindow().
Referenced by CL_PopupInit().
static void CL_PopupChangeHomebase_f | ( | void | ) | [static] |
User select a base in the popup_homebase change homebase to selected base.
< Use this so we do not change the original popupListData pointer.
Definition at line 162 of file cp_popup.c.
References AIR_MoveAircraftIntoNewHomebase(), B_GetFoundedBaseByIDX(), ccs, CL_DisplayHomebasePopup(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), linkedList_s::data, data, DEBUG_CLIENT, i, INVALID_BASE, linkedList_s::next, popupNum, qfalse, qtrue, ccs_s::selectedAircraft, and UI_PopWindow().
Referenced by CL_PopupInit().
void CL_PopupInit | ( | void | ) |
Initialise popups.
Definition at line 615 of file cp_popup.c.
References CL_PopupAircraftClick_f(), CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_PopupInterceptClick_f(), CL_PopupInterceptRClick_f(), and Cmd_AddCommand().
Referenced by CP_CampaignInit().
static void CL_PopupInterceptBaseClick_f | ( | void | ) | [static] |
User select a base in the popup_aircraft Make the base attack the corresponding UFO.
Definition at line 539 of file cp_popup.c.
References AII_BaseCanShoot(), AII_InstallationCanShoot(), B_GetFoundedBaseByIDX(), base_s::batteries, installation_s::batteries, ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, INS_GetFoundedInstallationByIDX(), installation_s::installationTemplate, base_s::lasers, MAX_BASES, MAX_INSTALLATIONS, installationTemplate_s::maxBatteries, base_s::numBatteries, base_s::numLasers, qfalse, qtrue, ccs_s::selectedUFO, baseWeapon_s::target, and UI_PopWindow().
Referenced by CL_PopupInit().
static void CL_PopupInterceptClick_f | ( | void | ) | [static] |
User select an item in the popup_aircraft Make the aircraft attack the corresponding mission or UFO.
Definition at line 490 of file cp_popup.c.
References _, AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), B_COMMAND, B_GetBuildingStatus(), CL_PopupInterceptGetAircraft_f(), aircraft_s::homebase, popup_intercept_s::mission, popup_intercept_s::ufo, and UI_Popup().
Referenced by CL_PopupInit().
static aircraft_t* CL_PopupInterceptGetAircraft_f | ( | void | ) | [static] |
return the selected aircraft in popup_intercept Close the popup if required
Definition at line 468 of file cp_popup.c.
References popup_intercept_s::aircraft, Cmd_Argc(), Cmd_Argv(), popup_intercept_s::numAircraft, qfalse, and UI_PopWindow().
Referenced by CL_PopupInterceptClick_f(), and CL_PopupInterceptRClick_f().
static void CL_PopupInterceptRClick_f | ( | void | ) | [static] |
User select an item in the popup_aircraft with right click Opens up the aircraft menu.
Definition at line 519 of file cp_popup.c.
References AIR_AircraftSelect(), B_SelectBase(), CL_PopupInterceptGetAircraft_f(), aircraft_s::homebase, MAP_ResetAction(), and UI_PushWindow().
Referenced by CL_PopupInit().
void CP_PopupList | ( | const char * | title, | |
const char * | text | |||
) |
Wrapper around UI_Popup
which also stops the time.
Definition at line 635 of file cp_popup.c.
References CL_GameTimeStop(), and UI_Popup().
Referenced by B_BuildBase_f(), and MS_AddNewMessageSound().
int INVALID_BASE = -1 [static] |
Definition at line 91 of file cp_popup.c.
Referenced by CL_DisplayHomebasePopup(), and CL_PopupChangeHomebase_f().
popup_aircraft_t popupAircraft [static] |
Data about popup_aircraft
Definition at line 70 of file cp_popup.c.
popup_intercept_t popupIntercept [static] |
Data about popup_intercept
Definition at line 84 of file cp_popup.c.
linkedList_t* popupListData = NULL [static] |
Further datas needed when popup is clicked
Definition at line 88 of file cp_popup.c.
uiNode_t* popupListNode = NULL [static] |
Node used for popup
Definition at line 89 of file cp_popup.c.
int popupNum [static] |
Reservation-popup info Number of entries in the popup list
Definition at line 87 of file cp_popup.c.
Referenced by CL_DisplayHomebasePopup(), and CL_PopupChangeHomebase_f().