UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_statistics.cpp File Reference

Campaign statistics. More...

#include "../../cl_shared.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_xvi.h"
#include "save/save_statistics.h"
Include dependency graph for cp_statistics.cpp:

Go to the source code of this file.

Macros

#define MAX_STATS_BUFFER   2048

Functions

static void STATS_Update_f (void)
 Shows the current stats from stats_t stats.
static void STAT_GetExpenses_f (void)
 Console command for UI to gather expenses.
bool STATS_SaveXML (xmlNode_t *parent)
 Save callback for savegames in XML Format.
bool STATS_LoadXML (xmlNode_t *parent)
 Load callback for savegames in XML Format.
void STATS_InitStartup (void)
void STATS_ShutDown (void)

Variables

static const cmdList_t statisticsCallbacks []

Detailed Description

Campaign statistics.

Definition in file cp_statistics.cpp.

Macro Definition Documentation

◆ MAX_STATS_BUFFER

#define MAX_STATS_BUFFER   2048

Definition at line 31 of file cp_statistics.cpp.

Referenced by STATS_Update_f().

Function Documentation

◆ STAT_GetExpenses_f()

void STAT_GetExpenses_f ( void )
static

Console command for UI to gather expenses.

Todo
should have something like CP_GetCurrentCampaign

Definition at line 59 of file cp_statistics.cpp.

References _, AIR_CRASHED, AIR_Foreach, salary_t::aircraftDivisor, salary_t::aircraftFactor, B_GetNext(), ccs, cgi, count, CP_GetSalaryUpKeepBase(), salary_t::debtInterest, E_Foreach, i, base_t::idx, MAX_EMPL, MAX_VAR, base_t::name, ngettext, Q_strncpyz(), and campaign_t::salaries.

◆ STATS_InitStartup()

void STATS_InitStartup ( void )

Definition at line 213 of file cp_statistics.cpp.

References cgi, and statisticsCallbacks.

Referenced by CP_InitStartup().

◆ STATS_LoadXML()

◆ STATS_SaveXML()

◆ STATS_ShutDown()

void STATS_ShutDown ( void )

Definition at line 218 of file cp_statistics.cpp.

References cgi, and statisticsCallbacks.

Referenced by CP_Shutdown().

◆ STATS_Update_f()

void STATS_Update_f ( void )
static

Shows the current stats from stats_t stats.

Todo
This is very redundant with NAT_HandleBudget Investigate and clean up.

Definition at line 36 of file cp_statistics.cpp.

References _, ccs, cgi, CP_GetAverageXVIRate(), CP_IsXVIVisible(), MAX_STATS_BUFFER, campaign_t::maxAllowedXVIRateUntilLost, campaign_t::negativeCreditsUntilLost, OBJZERO, Q_strcat(), and TEXT_GENERIC.

Variable Documentation

◆ statisticsCallbacks

const cmdList_t statisticsCallbacks[]
static
Initial value:
= {
{"stats_update", STATS_Update_f, "Update capaign statistics UI"},
{"stats_getexpenses", STAT_GetExpenses_f, "Gather expenses for the statistics UI"},
{nullptr, nullptr, nullptr}
}
static void STATS_Update_f(void)
Shows the current stats from stats_t stats.
static void STAT_GetExpenses_f(void)
Console command for UI to gather expenses.

Definition at line 206 of file cp_statistics.cpp.

Referenced by STATS_InitStartup(), and STATS_ShutDown().