UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_market_callbacks.cpp File Reference
#include "../../cl_shared.h"
#include "../../cl_inventory.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_market.h"
#include "cp_market_callbacks.h"
#include "cp_popup.h"
Include dependency graph for cp_market_callbacks.cpp:

Go to the source code of this file.

Functions

static void BS_MarketAircraftDescription (const aircraft_t *aircraftTemplate)
 Prints general information about aircraft for Buy/Sell menu.
static void BS_MarketInfoClick_f (void)
 Opens the UFOpedia for the current selected item/aircraft/ugv.
static void BS_SetAutosell_f (void)
 Sets/unsets or flips the autosell property of an item on the market.
static void BS_Buy_f (void)
 Buy/Sell item/aircraft/ugv on the market.
static void BS_ShowInfo_f (void)
 Show information about item/aircaft/ugv in the market.
static void BS_FillMarket_f (void)
 Fill market item list.
void BS_InitCallbacks (void)
 Function registers the callbacks of the maket UI and do initializations.
void BS_ShutdownCallbacks (void)
 Function unregisters the callbacks of the maket UI.

Variables

static const cmdList_t marketCallbacks []

Function Documentation

◆ BS_Buy_f()

◆ BS_FillMarket_f()

◆ BS_InitCallbacks()

void BS_InitCallbacks ( void )

Function registers the callbacks of the maket UI and do initializations.

Definition at line 480 of file cp_market_callbacks.cpp.

References cgi, and marketCallbacks.

Referenced by CP_AddCampaignCallbackCommands().

◆ BS_MarketAircraftDescription()

void BS_MarketAircraftDescription ( const aircraft_t * aircraftTemplate)
static

Prints general information about aircraft for Buy/Sell menu.

Parameters
[in]aircraftTemplateAircraft type.
See also
UP_AircraftDescription
UP_AircraftItemDescription

Definition at line 38 of file cp_market_callbacks.cpp.

References _, cgi, aircraft_t::id, aircraft_t::name, aircraft_t::tech, aircraft_t::tpl, and UP_AircraftDescription().

Referenced by BS_ShowInfo_f().

◆ BS_MarketInfoClick_f()

void BS_MarketInfoClick_f ( void )
static

Opens the UFOpedia for the current selected item/aircraft/ugv.

Note
called by ui_market_openpedia

Definition at line 57 of file cp_market_callbacks.cpp.

References cgi, technology_t::id, RS_GetTechByProvided(), and UP_OpenWith().

◆ BS_SetAutosell_f()

void BS_SetAutosell_f ( void )
static

Sets/unsets or flips the autosell property of an item on the market.

Definition at line 69 of file cp_market_callbacks.cpp.

References AIR_GetAircraftSilent(), ccs, cgi, objDef_t::id, objDef_t::idx, INVSH_GetItemByID(), objDef_t::isVirtual, objDef_t::notOnMarket, RS_GetTechForItem(), and RS_IsResearched_ptr().

◆ BS_ShowInfo_f()

void BS_ShowInfo_f ( void )
static

Show information about item/aircaft/ugv in the market.

Todo
show specialized info about PHALANX aircraft
Todo
show specialized info about PHLANX UGVs

Definition at line 282 of file cp_market_callbacks.cpp.

References AIR_AircraftGetFromIDX(), AIR_GetAircraftSilent(), BS_IsOnMarket(), BS_MarketAircraftDescription(), cgi, objDef_t::craftitem, E_GetEmployeeByTypeFromChrUCN(), EMPL_ROBOT, Employee::getUGV(), INVSH_GetItemByID(), MAX_ACITEMS, Q_strstart(), aircraft_t::tpl, craftItem::type, UP_AircraftItemDescription(), and UP_UGVDescription().

◆ BS_ShutdownCallbacks()

void BS_ShutdownCallbacks ( void )

Function unregisters the callbacks of the maket UI.

Definition at line 488 of file cp_market_callbacks.cpp.

References cgi, and marketCallbacks.

Referenced by CP_RemoveCampaignCallbackCommands().

Variable Documentation

◆ marketCallbacks

const cmdList_t marketCallbacks[]
static
Initial value:
= {
{"ui_market_openpedia", BS_MarketInfoClick_f, "Open UFOPedia entry for selected item"},
{"ui_market_setautosell", BS_SetAutosell_f, "Sets/unsets or flips the autosell property of an item on the market"},
{"ui_market_buy", BS_Buy_f, "Buy/Sell item/aircraft/ugv on the market"},
{"ui_market_showinfo", BS_ShowInfo_f, "Show information about item/aircaft/ugv in the market"},
{"ui_market_fill", BS_FillMarket_f, "Fill market item list"},
{nullptr, nullptr, nullptr}
}
static void BS_MarketInfoClick_f(void)
Opens the UFOpedia for the current selected item/aircraft/ugv.
static void BS_SetAutosell_f(void)
Sets/unsets or flips the autosell property of an item on the market.
static void BS_ShowInfo_f(void)
Show information about item/aircaft/ugv in the market.
static void BS_FillMarket_f(void)
Fill market item list.
static void BS_Buy_f(void)
Buy/Sell item/aircraft/ugv on the market.

Definition at line 466 of file cp_market_callbacks.cpp.

Referenced by BS_InitCallbacks(), and BS_ShutdownCallbacks().