cp_popup.c File Reference

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"
Include dependency graph for cp_popup.c:

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_tCL_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_tpopupListData = NULL
static uiNode_tpopupListNode = NULL
static int INVALID_BASE = -1

Detailed Description

Manage popups.

Definition in file cp_popup.c.


Define Documentation

#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 Documentation

Structure to store information about popup_aircraft.


Enumeration Type Documentation

Enumerate type of actions available for popup_aircraft.

Enumerator:
POPUP_AIRCRAFT_ACTION_BACKTOBASE 

Aircraft back to base

POPUP_AIRCRAFT_ACTION_STOP 

Aircraft stops

POPUP_AIRCRAFT_ACTION_MOVETOMISSION 

Aircraft move to a mission

POPUP_AIRCRAFT_CHANGE_HOMEBASE 

Change aircraft homebase

POPUP_AIRCRAFT_ACTION_NONE 

Do nothing

POPUP_AIRCRAFT_ACTION_MAX 

Definition at line 47 of file cp_popup.c.


Function Documentation

qboolean CL_DisplayHomebasePopup ( aircraft_t aircraft,
qboolean  alwaysDisplay 
)

Display the popup_homebase.

Parameters:
[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.
Returns:
true if popup is displayed.

< 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  ) 
void CL_DisplayPopupInterceptMission ( mission_t mission  ) 
void CL_DisplayPopupInterceptUFO ( aircraft_t ufo  ) 
static void CL_PopupAircraftClick_f ( void   )  [static]
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   ) 
static void CL_PopupInterceptBaseClick_f ( void   )  [static]
static void CL_PopupInterceptClick_f ( void   )  [static]

User select an item in the popup_aircraft Make the aircraft attack the corresponding mission or UFO.

Todo:
are these newlines really needed? at least the first should be handled by the menu code

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().


Variable Documentation

int INVALID_BASE = -1 [static]

Definition at line 91 of file cp_popup.c.

Referenced by CL_DisplayHomebasePopup(), and CL_PopupChangeHomebase_f().

Todo:
Save me why? The popup stuff should be regenerated from the campaign data --mattn

Data about popup_aircraft

Definition at line 70 of file cp_popup.c.

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().


Generated by  doxygen 1.6.2