UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_ufopedia.h File Reference

Header file for UFOpaedia script interpreter. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pediaChapter_t

Macros

#define MAX_PEDIACHAPTERS   16

Functions

void UP_InitStartup (void)
void UP_Shutdown (void)
void UP_ParseChapter (const char *name, const char **text)
 Parse the UFOpaedia chapters from scripts.
void UP_OpenWith (const char *name)
 Opens the UFOpaedia from everywhere with the entry given through name.
void UP_OpenCopyWith (const char *name)
 Opens the UFOpaedia with the entry given through name, not deleting copies.
void UP_AircraftItemDescription (const objDef_t *item)
 Prints the (UFOpaedia and other) description for aircraft items.
int UP_GetUnreadMails (void)
 Sets the amount of unread/new mails.
void UP_OpenEventMail (const char *eventMailID)

Detailed Description

Header file for UFOpaedia script interpreter.

Definition in file cp_ufopedia.h.

Macro Definition Documentation

◆ MAX_PEDIACHAPTERS

#define MAX_PEDIACHAPTERS   16

Definition at line 28 of file cp_ufopedia.h.

Referenced by UP_ParseChapter().

Function Documentation

◆ UP_AircraftItemDescription()

void UP_AircraftItemDescription ( const objDef_t * item)

Prints the (UFOpaedia and other) description for aircraft items.

Parameters
itemThe object definition of the item
See also
UP_Article Not only called from UFOpaedia but also from other places to display
Todo
Don't display things like speed for base defence items - a missile facility isn't getting slower or faster due a special weapon or ammunition

Definition at line 228 of file cp_ufopedia.cpp.

References _, AC_ITEM_AMMO, AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, AC_ITEM_WEAPON, AII_GetItemWeightBySize(), AII_WeightToName(), AIR_AircraftMenuStatsValues(), AIR_STATS_MAX, AIR_STATS_WRANGE, objDef_t::ammo, objDef_t::ammos, cgi, objDef_t::craftitem, EQUAL, i, objDef_t::id, technology_t::mdl, objDef_t::name, objDef_t::numAmmos, Q_strcat(), RS_GetTechForItem(), RS_IsResearched_ptr(), craftItem::stats, TEXT_ITEMDESCRIPTION, craftItem::type, UP_AircraftStatToName(), craftItem::weaponDamage, and craftItem::weaponDelay.

Referenced by AIM_UpdateItemDescription(), BDEF_SelectItem_f(), BS_ShowInfo_f(), and UP_Article().

◆ UP_GetUnreadMails()

int UP_GetUnreadMails ( void )

Sets the amount of unread/new mails.

Note
This is called every campaign frame - to update ccs.numUnreadMails just set it to -1 before calling this function
See also
CP_CampaignRun

Definition at line 436 of file cp_ufopedia.cpp.

References ccs, cgi, m, MSG_EVENT, MSG_NEWS, MSG_RESEARCH_FINISHED, MSG_RESEARCH_PROPOSAL, RS_IsResearched_ptr(), TECHMAIL_PRE, and TECHMAIL_RESEARCHED.

Referenced by CP_CampaignRun(), and UP_MailClientClick_f().

◆ UP_InitStartup()

void UP_InitStartup ( void )
See also
cgi->UI_InitStartup

Definition at line 1157 of file cp_ufopedia.cpp.

References cgi, mn_uppreavailable, mn_uppretext, and ufopediaCmds.

Referenced by CP_InitStartup().

◆ UP_OpenCopyWith()

void UP_OpenCopyWith ( const char * techID)

Opens the UFOpaedia with the entry given through name, not deleting copies.

Parameters
techIDUFOpaedia entry id (technology script id)
See also
UP_FindEntry_f

Definition at line 752 of file cp_ufopedia.cpp.

References cgi.

◆ UP_OpenEventMail()

void UP_OpenEventMail ( const char * eventMailID)
See also
CL_EventAddMail_f

Definition at line 708 of file cp_ufopedia.cpp.

References cgi, CL_GetEventMail(), and UP_Article().

Referenced by CL_EventAddMail(), and UP_MailClientClick_f().

◆ UP_OpenWith()

void UP_OpenWith ( const char * techID)

Opens the UFOpaedia from everywhere with the entry given through name.

Parameters
techIDUFOpaedia entry id (technology script id)
See also
UP_FindEntry_f

Definition at line 738 of file cp_ufopedia.cpp.

References cgi.

Referenced by B_BuildingOpenAfterClick_f(), BS_MarketInfoClick_f(), PR_ProductionListRightClick_f(), RS_ResearchFinish(), UP_ResearchedLinkClick_f(), and UP_TechTreeClick_f().

◆ UP_ParseChapter()

void UP_ParseChapter ( const char * name,
const char ** text )

Parse the UFOpaedia chapters from scripts.

Parameters
[in]nameChapter ID
[in]textText for chapter ID
See also
CL_ParseFirstScript

Definition at line 1188 of file cp_ufopedia.cpp.

References ccs, cgi, Com_Parse(), cp_campaignPool, ERR_DROP, pediaChapter_t::id, pediaChapter_t::idx, MAX_PEDIACHAPTERS, name, pediaChapter_t::name, OBJZERO, and Q_streq.

Referenced by CP_ParseScriptFirst().

◆ UP_Shutdown()

void UP_Shutdown ( void )
See also
UI_InitStartup

Definition at line 1171 of file cp_ufopedia.cpp.

References cgi, and ufopediaCmds.

Referenced by CP_RemoveCampaignCallbackCommands().