UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
cp_ufo_callbacks.cpp
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
*/
24
25
#include "
../../cl_shared.h
"
26
#include "
cp_ufo_callbacks.h
"
27
#include "
cp_campaign.h
"
28
#include "
cp_geoscape.h
"
29
#include "
cp_ufo.h
"
30
#include "
cp_popup.h
"
31
35
static
void
UFO_GeoSelectUFO_f
(
void
)
36
{
37
if
(
cgi
->Cmd_Argc() < 2) {
38
return
;
39
}
40
41
const
int
index
= atoi(
cgi
->Cmd_Argv(1));
42
if
(
index < 0 || index >
=
ccs
.numUFOs)
43
return
;
44
aircraft_t
* aircraft =
UFO_GetByIDX
(
index
);
45
if
(aircraft ==
nullptr
)
46
return
;
47
48
if
(!
GEO_IsUFOSelected
(aircraft))
49
GEO_SelectUFO
(aircraft);
51
CL_DisplayPopupInterceptUFO
(aircraft);
52
}
53
54
static
const
cmdList_t
ufoCallbacks
[] = {
55
{
"geo_ufo_select"
,
UFO_GeoSelectUFO_f
,
nullptr
},
56
{
nullptr
,
nullptr
,
nullptr
}
57
};
58
59
void
UFO_InitCallbacks
(
void
)
60
{
61
cgi
->Cmd_TableAddList(
ufoCallbacks
);
62
}
63
64
void
UFO_ShutdownCallbacks
(
void
)
65
{
66
cgi
->Cmd_TableRemoveList(
ufoCallbacks
);
67
}
cl_shared.h
Share stuff between the different cgame implementations.
ccs
ccs_t ccs
Definition
cp_campaign.cpp:63
cp_campaign.h
Header file for single player campaign control.
cgi
const cgame_import_t * cgi
Definition
cp_cgame_callbacks.cpp:39
GEO_SelectUFO
void GEO_SelectUFO(aircraft_t *ufo)
Select the specified ufo on the geoscape.
Definition
cp_geoscape.cpp:1665
cp_geoscape.h
Header for Geoscape management.
GEO_IsUFOSelected
#define GEO_IsUFOSelected(ufo)
Definition
cp_geoscape.h:53
CL_DisplayPopupInterceptUFO
void CL_DisplayPopupInterceptUFO(aircraft_t *ufo)
Display the popup_intercept.
Definition
cp_popup.cpp:238
cp_popup.h
UFO_GetByIDX
aircraft_t * UFO_GetByIDX(const int idx)
returns the UFO on the geoscape with a certain index
Definition
cp_ufo.cpp:85
cp_ufo.h
UFO_InitCallbacks
void UFO_InitCallbacks(void)
Definition
cp_ufo_callbacks.cpp:59
UFO_GeoSelectUFO_f
static void UFO_GeoSelectUFO_f(void)
Select ufo on Geoscape.
Definition
cp_ufo_callbacks.cpp:35
UFO_ShutdownCallbacks
void UFO_ShutdownCallbacks(void)
Definition
cp_ufo_callbacks.cpp:64
ufoCallbacks
static const cmdList_t ufoCallbacks[]
Definition
cp_ufo_callbacks.cpp:54
cp_ufo_callbacks.h
Header file for menu related console command callbacks.
index
QGL_EXTERN GLuint index
Definition
r_gl.h:110
aircraft_t
An aircraft with all it's data.
Definition
cp_aircraft.h:115
cmdList_t
Definition
cmd.h:86
src
client
cgame
campaign
cp_ufo_callbacks.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0