UFO: Alien Invasion
|
Manage popups. More...
#include "../../cl_shared.h"
#include "cp_campaign.h"
#include "cp_mapfightequip.h"
#include "cp_geoscape.h"
#include "cp_popup.h"
#include "cp_missions.h"
#include "cp_time.h"
#include "cp_aircraft_callbacks.h"
#include "../../ui/ui_dataids.h"
Go to the source code of this file.
Data Structures | |
struct | popup_intercept_s |
Macros | |
#define | POPUP_INTERCEPT_MAX_AIRCRAFT 64 |
#define | AIR_ForeachSorted(var, sorter, userdata, sortedlist) LIST_ForeachSorted(ccs.aircraft, aircraft_t, var, sorter, userdata, sortedlist) |
Typedefs | |
typedef struct popup_intercept_s | popup_intercept_t |
Functions | |
bool | CL_DisplayHomebasePopup (aircraft_t *aircraft, bool alwaysDisplay) |
Display the popup_homebase. More... | |
static void | CL_PopupChangeHomebase_f (void) |
User select a base in the popup_homebase change homebase to selected base. More... | |
static int | AIR_SortByDistance (linkedList_t *aircraftEntry1, linkedList_t *aircraftEntry2, const void *userData) |
void | CL_DisplayPopupInterceptMission (mission_t *mission) |
Display the popup_mission. More... | |
void | CL_DisplayPopupInterceptUFO (aircraft_t *ufo) |
Display the popup_intercept. More... | |
static aircraft_t * | CL_PopupInterceptGetAircraft (void) |
return the selected aircraft in popup_intercept Close the popup if required More... | |
static void | CL_PopupInterceptClick_f (void) |
User select an item in the popup_aircraft Make the aircraft attack the corresponding mission or UFO. More... | |
static void | CL_PopupInterceptRClick_f (void) |
User select an item in the popup_aircraft with right click Opens up the aircraft menu. More... | |
static void | CL_PopupInterceptBaseClick_f (void) |
User select a base in the popup_aircraft Make the base attack the corresponding UFO. More... | |
void | CL_PopupInit (void) |
Initialise popups. More... | |
void | CP_Popup (const char *title, const char *text,...) |
Wrapper around UI_Popup . More... | |
Variables | |
static popup_intercept_t | popupIntercept |
static int | popupNum |
static linkedList_t * | popupListData = nullptr |
static uiNode_t * | popupListNode = nullptr |
static int | INVALID_BASE = -1 |
Manage popups.
Definition in file cp_popup.cpp.
#define AIR_ForeachSorted | ( | var, | |
sorter, | |||
userdata, | |||
sortedlist | |||
) | LIST_ForeachSorted(ccs.aircraft, aircraft_t, var, sorter, userdata, sortedlist) |
Definition at line 178 of file cp_popup.cpp.
Referenced by CL_DisplayPopupInterceptMission(), and CL_DisplayPopupInterceptUFO().
#define POPUP_INTERCEPT_MAX_AIRCRAFT 64 |
Max aircraft in popup list
Definition at line 38 of file cp_popup.cpp.
Referenced by CL_DisplayPopupInterceptMission(), and CL_DisplayPopupInterceptUFO().
typedef struct popup_intercept_s popup_intercept_t |
|
static |
Definition at line 168 of file cp_popup.cpp.
References linkedList_t::data, GetDistanceOnGlobe(), and aircraft_s::pos.
Referenced by CL_DisplayPopupInterceptMission(), and CL_DisplayPopupInterceptUFO().
bool CL_DisplayHomebasePopup | ( | aircraft_t * | aircraft, |
bool | 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 66 of file cp_popup.cpp.
References _, AIR_CheckMoveIntoNewHomebase(), B_GetNext(), cgi, Com_sprintf(), CP_GameTimeStop(), GEO_SelectAircraft(), aircraft_s::homebase, base_s::idx, INVALID_BASE, LIST_Add(), MAX_VAR, base_s::name, popupNum, uiNode_t::selectedColor, cgame_import_s::UI_PopupList(), and VectorSet.
Referenced by AIR_ShowChangeHomebaseAircraft_f(), and CL_PopupChangeHomebase_f().
Display the popup_mission.
Definition at line 184 of file cp_popup.cpp.
References _, AIR_AircraftStatusToName(), AIR_CanIntercept(), AIR_CRASHED, AIR_ForeachSorted, AIR_GetTeamSize(), AIR_SortByDistance(), AIR_STATS_SPEED, popup_intercept_s::aircraft, cgi, Com_sprintf(), CP_GameTimeStop(), CP_SecondConvert(), GetDistanceOnGlobe(), popup_intercept_s::mission, popup_intercept_s::numAircraft, POPUP_INTERCEPT_MAX_AIRCRAFT, mission_s::pos, SECONDS_PER_HOUR, TEXT_AIRCRAFT_LIST, and popup_intercept_s::ufo.
Referenced by MIS_GeoSelectMission_f().
void CL_DisplayPopupInterceptUFO | ( | aircraft_t * | ufo | ) |
Display the popup_intercept.
Definition at line 237 of file cp_popup.cpp.
References _, AII_BaseCanShoot(), AII_InstallationCanShoot(), AIR_AircraftHasEnoughFuel(), AIR_AircraftStatusToName(), AIR_CanIntercept(), AIR_ForeachSorted, AIR_GetTeamSize(), AIR_SortByDistance(), popup_intercept_s::aircraft, AIRFIGHT_ChooseWeapon(), AIRFIGHT_WEAPON_CAN_NEVER_SHOOT, B_GetNext(), cgi, Com_sprintf(), CP_GameTimeStop(), DEBUG_CLIENT, INS_Foreach, popup_intercept_s::mission, base_s::name, popup_intercept_s::numAircraft, POPUP_INTERCEPT_MAX_AIRCRAFT, aircraft_s::pos, TEXT_AIRCRAFT_LIST, TEXT_BASE_LIST, popup_intercept_s::ufo, and va().
Referenced by UFO_GeoSelectUFO_f().
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 122 of file cp_popup.cpp.
References AIR_CheckMoveIntoNewHomebase(), AIR_MoveAircraftIntoNewHomebase(), B_GetFoundedBaseByIDX(), cgi, CL_DisplayHomebasePopup(), cgame_import_s::Cmd_Argv(), linkedList_t::data, DEBUG_CLIENT, GEO_GetSelectedAircraft, i, INVALID_BASE, linkedList_t::next, popupListData, and popupNum.
Referenced by CL_PopupInit().
Initialise popups.
Definition at line 457 of file cp_popup.cpp.
References cgi, CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_PopupInterceptClick_f(), CL_PopupInterceptRClick_f(), and OBJZERO.
Referenced by CP_CampaignInit().
User select a base in the popup_aircraft Make the base attack the corresponding UFO.
Definition at line 389 of file cp_popup.cpp.
References AII_BaseCanShoot(), AII_InstallationCanShoot(), B_GetNext(), installation_s::batteries, cgi, cgame_import_s::Cmd_Argv(), GEO_GetSelectedUFO, i, INS_Foreach, installation_s::installationTemplate, installationTemplate_s::maxBatteries, and baseWeapon_s::target.
Referenced by CL_PopupInit().
User select an item in the popup_aircraft Make the aircraft attack the corresponding mission or UFO.
Definition at line 340 of file cp_popup.cpp.
References _, AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), B_COMMAND, B_GetBuildingStatus(), CL_PopupInterceptGetAircraft(), CP_Popup(), aircraft_s::homebase, popup_intercept_s::mission, and popup_intercept_s::ufo.
Referenced by CL_PopupInit().
|
static |
return the selected aircraft in popup_intercept Close the popup if required
Definition at line 318 of file cp_popup.cpp.
References popup_intercept_s::aircraft, cgi, cgame_import_s::Cmd_Argv(), and popup_intercept_s::numAircraft.
Referenced by CL_PopupInterceptClick_f(), and CL_PopupInterceptRClick_f().
User select an item in the popup_aircraft with right click Opens up the aircraft menu.
Definition at line 369 of file cp_popup.cpp.
References AIR_AircraftSelect(), B_SelectBase(), cgi, CL_PopupInterceptGetAircraft(), GEO_ResetAction(), and aircraft_s::homebase.
Referenced by CL_PopupInit().
void CP_Popup | ( | const char * | title, |
const char * | text, | ||
... | |||
) |
Wrapper around UI_Popup
.
Definition at line 473 of file cp_popup.cpp.
References cgi, and Q_vsnprintf().
Referenced by AIM_AircraftStart_f(), AIR_SendAircraftToMission(), B_BuildBase_f(), B_BuildBuilding_f(), B_BuildingDestroy_f(), B_BuildingOpenAfterClick_f(), BS_Buy_f(), CL_PopupInterceptClick_f(), E_HireEmployee(), INS_BuildInstallation_f(), MS_AddNewMessage(), PR_ProductionIncrease_f(), RS_AssignScientist(), SAV_GameQuickLoad_f(), and SAV_GameSave_f().
|
static |
Definition at line 54 of file cp_popup.cpp.
Referenced by CL_DisplayHomebasePopup(), and CL_PopupChangeHomebase_f().
|
static |
Data about popup_intercept
Definition at line 47 of file cp_popup.cpp.
|
static |
Further datas needed when popup is clicked
Definition at line 51 of file cp_popup.cpp.
Referenced by CL_PopupChangeHomebase_f().
Node used for popup
Definition at line 52 of file cp_popup.cpp.
|
static |
Reservation-popup info Number of entries in the popup list
Definition at line 50 of file cp_popup.cpp.
Referenced by CL_DisplayHomebasePopup(), and CL_PopupChangeHomebase_f().