UFO: Alien Invasion
|
Menu related callback functions used for production. More...
#include "../../cl_shared.h"
#include "../../cl_inventory.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_market.h"
#include "cp_ufo.h"
#include "cp_popup.h"
#include "cp_produce.h"
#include "cp_produce_callbacks.h"
#include "cp_base.h"
Go to the source code of this file.
Functions | |
static void | PR_ClearSelectedItems (void) |
Resets the selected item data structure. Does not reset the selected production. More... | |
static void | PR_ClearSelected (void) |
Resets all "selected" pointers to nullptr. More... | |
static void | PR_UpdateProductionList (const base_t *base) |
update the list of queued and available items More... | |
static void | PR_RequirementsInfo (const base_t *base, const requirements_t *reqs) |
static void | PR_ItemProductionInfo (const base_t *base, const objDef_t *od, int remainingHours) |
Prints information about the selected item (no aircraft) in production. More... | |
static void | PR_DisassemblyInfo (const storedUFO_t *ufo, int remainingHours) |
Prints information about the selected disassembly task. More... | |
static void | PR_AircraftInfo (const base_t *base, const aircraft_t *aircraftTemplate, int remainingHours) |
Prints information about the selected aircraft in production. More... | |
static void | PR_ProductionInfo (const base_t *base) |
Prints information about the selected item in production. More... | |
static void | PR_ProductionListRightClick_f (void) |
Click function for production list. More... | |
static void | PR_ProductionListClick_f (void) |
Click function for production list. More... | |
static void | PR_ProductionType_f (void) |
Will select a new tab on the production list. More... | |
static void | PR_ProductionList_f (void) |
Will fill the list of producible items. More... | |
static void | PR_ProductionIncrease_f (void) |
Increases the production amount by given parameter. More... | |
static void | PR_ProductionStop_f (void) |
Stops the current running production. More... | |
static void | PR_ProductionDecrease_f (void) |
Decrease the production amount by given parameter. More... | |
static void | PR_ProductionChange_f (void) |
Change the production amount by given diff. More... | |
static void | PR_ProductionUp_f (void) |
shift the current production up the list More... | |
static void | PR_ProductionDown_f (void) |
shift the current production down the list More... | |
static void | PR_ShowActiveProduction_f (void) |
Show active production item in Base sections. More... | |
void | PR_InitCallbacks (void) |
void | PR_ShutdownCallbacks (void) |
Variables | |
static itemFilterTypes_t | produceCategory = FILTER_S_PRIMARY |
static production_t * | selectedProduction = nullptr |
static linkedList_t * | productionItemList |
static productionData_t | selectedData |
static const int | QUEUE_SPACERS = 2 |
Number of blank lines between queued items and tech list. More... | |
static const cmdList_t | productionCallbacks [] |
Menu related callback functions used for production.
Definition in file cp_produce_callbacks.cpp.
|
static |
Prints information about the selected aircraft in production.
[in] | base | Pointer to the base where information should be printed. |
[in] | aircraftTemplate | The aircraft to print the information for |
[in] | remainingHours | The remaining hours until this production is finished |
Definition at line 320 of file cp_produce_callbacks.cpp.
References _, cgi, Com_sprintf(), cgame_import_s::Cvar_Set(), aircraft_s::id, aircraft_s::name, requirements_s::numLinks, PR_GetPrice(), PR_RequirementsInfo(), aircraft_s::productionCost, Q_strcat(), technology_s::requireForProduction, aircraft_s::tech, and TEXT_PRODUCTION_INFO.
Referenced by PR_ProductionInfo().
Resets all "selected" pointers to nullptr.
Definition at line 68 of file cp_produce_callbacks.cpp.
References PR_ClearSelectedItems().
Referenced by PR_ProductionList_f(), PR_ProductionListClick_f(), and PR_ProductionListRightClick_f().
Resets the selected item data structure. Does not reset the selected production.
Definition at line 58 of file cp_produce_callbacks.cpp.
References OBJZERO, PRODUCTION_TYPE_MAX, and productionData_t::type.
Referenced by PR_ClearSelected(), and PR_ProductionType_f().
|
static |
Prints information about the selected disassembly task.
[in] | ufo | The UFO being disassembled. |
[in] | remainingHours | The remaining hours until this production is finished |
Definition at line 286 of file cp_produce_callbacks.cpp.
References _, cgi, Com_sprintf(), storedUFO_s::comp, COMP_ITEMCOUNT_SCALED, storedUFO_s::condition, cgame_import_s::Cvar_Set(), aircraft_s::getUfoType(), i, storedUFO_s::id, storedUFO_s::installation, components_s::itemAmount, components_s::itemAmount2, components_s::items, installation_s::name, objDef_s::name, components_s::numItemtypes, Q_strcat(), TEXT_PRODUCTION_INFO, UFO_TypeToName(), and storedUFO_s::ufoTemplate.
Referenced by PR_ProductionInfo().
Definition at line 873 of file cp_produce_callbacks.cpp.
References cgi.
Referenced by CP_AddCampaignCallbackCommands().
|
static |
Prints information about the selected item (no aircraft) in production.
[in] | base | Pointer to the base where information should be printed. |
[in] | od | The attributes of the item being produced. |
[in] | remainingHours | The remaining hours until this production is finished |
Definition at line 254 of file cp_produce_callbacks.cpp.
References _, cgi, Com_sprintf(), cgame_import_s::Cvar_Set(), objDef_s::id, objDef_s::name, requirements_s::numLinks, PR_GetPrice(), PR_ItemIsProduceable(), PR_RequirementsInfo(), objDef_s::productionCost, Q_strcat(), technology_s::requireForProduction, RS_GetTechForItem(), objDef_s::size, and TEXT_PRODUCTION_INFO.
Referenced by PR_ProductionInfo().
Change the production amount by given diff.
Definition at line 766 of file cp_produce_callbacks.cpp.
References cgi, cgame_import_s::Cmd_Argv(), and PR_IsDataValid.
Decrease the production amount by given parameter.
Definition at line 737 of file cp_produce_callbacks.cpp.
References production_s::amount, B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), PR_DecreaseProduction(), PR_ProductionInfo(), PR_ProductionStop_f(), PR_UpdateProductionList(), and selectedProduction.
shift the current production down the list
Definition at line 815 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_s::idx, production_queue_s::items, production_queue_s::numItems, PR_GetProductionForBase, PR_QueueMove(), and PR_UpdateProductionList().
Increases the production amount by given parameter.
Definition at line 606 of file cp_produce_callbacks.cpp.
References _, AIR_GetHangarCapacityType(), productionData_t::productionItem_t::aircraft, production_s::amount, B_GetCurrentSelectedBase(), CAP_GetFreeCapacity(), cgi, cgame_import_s::Cmd_Argv(), Com_sprintf(), cp_messageBuffer, CP_Popup(), productionData_t::data, production_s::data, production_s::idx, MAX_PRODUCTION_AMOUNT, MSG_PRODUCTION, MSO_CheckAddNewMessage(), name, NT_PRODUCTION_STARTED, PR_GetName(), PR_GetTech(), PR_IncreaseProduction(), PR_IsAircraft, PR_IsAircraftData, PR_IsDataValid, PR_IsDisassembly, PR_ProductionInfo(), PR_QueueNew(), PR_RequirementsMet(), PR_UpdateProductionList(), technology_s::requireForProduction, and selectedProduction.
Prints information about the selected item in production.
[in] | base | Pointer to the base where information should be printed. |
Definition at line 340 of file cp_produce_callbacks.cpp.
References _, productionData_t::productionItem_t::aircraft, production_s::amount, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, CAP_GetFreeCapacity(), CAP_GetMax, CAP_ITEMS, CAP_WORKSPACE, cgi, cgame_import_s::Cvar_Set(), productionData_t::data, production_s::data, E_CountHired(), EMPL_WORKER, ERR_DROP, FILTER_AIRCRAFT, productionData_t::productionItem_t::item, PR_AircraftInfo(), PR_DisassemblyInfo(), PR_GetProductionHours(), PR_GetRemainingHours(), PR_IsAircraft, PR_IsAircraftData, PR_IsDataValid, PR_IsDisassembly, PR_IsDisassemblyData, PR_IsItem, PR_IsItemData, PR_ItemProductionInfo(), produceCategory, selectedProduction, TEXT_PRODUCTION_INFO, and productionData_t::productionItem_t::ufo.
Referenced by PR_ProductionDecrease_f(), PR_ProductionIncrease_f(), PR_ProductionListClick_f(), PR_ProductionStop_f(), and PR_ProductionType_f().
Will fill the list of producible items.
Definition at line 582 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), CAP_GetCurrent, CAP_GetMax, CAP_ITEMS, CAP_WORKSPACE, cgi, cgame_import_s::Cvar_Set(), E_CountHired(), EMPL_WORKER, PR_ClearSelected(), and PR_UpdateProductionCap().
Click function for production list.
Definition at line 458 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, base_s::idx, production_queue_s::items, cgame_import_s::LIST_GetByIdx(), production_queue_s::numItems, PR_ClearSelected(), PR_GetProductionForBase, PR_ItemIsProduceable(), PR_ProductionInfo(), PR_SetData, produceCategory, technology_s::produceTime, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), and aircraft_s::tech.
Click function for production list.
Definition at line 391 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), production_s::data, DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, technology_s::id, base_s::idx, production_queue_s::items, cgame_import_s::LIST_GetByIdx(), production_queue_s::numItems, PR_ClearSelected(), PR_GetProductionForBase, PR_GetTech(), PR_SetData, produceCategory, PRODUCTION_TYPE_ITEM, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), aircraft_s::tech, storedUFO_s::ufoTemplate, and UP_OpenWith().
Stops the current running production.
Definition at line 708 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_s::idx, production_queue_s::items, production_queue_s::numItems, PR_GetProductionForBase, PR_ProductionInfo(), PR_QueueDelete(), and PR_UpdateProductionList().
Referenced by PR_ProductionDecrease_f().
Will select a new tab on the production list.
Definition at line 526 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), cgame_import_s::Cvar_Set(), FILTER_AIRCRAFT, FILTER_DISASSEMBLY, FILTER_S_PRIMARY, cgame_import_s::INV_GetFilterType(), cgame_import_s::LIST_GetByIdx(), MAX_FILTERTYPES, production_queue_s::numItems, PR_ClearSelectedItems(), PR_GetProductionForBase, PR_ProductionInfo(), PR_SetData, PR_UpdateProductionList(), produceCategory, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, and QUEUE_SPACERS.
shift the current production up the list
Definition at line 792 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_s::idx, production_queue_s::items, PR_GetProductionForBase, PR_QueueMove(), and PR_UpdateProductionList().
|
static |
Definition at line 189 of file cp_produce_callbacks.cpp.
References _, requirement_s::amount, ANTIMATTER_ITEM_ID, B_AntimatterInBase(), B_ItemInBase(), cgi, uiNode_t::color, uiNode_t::firstChild, green, i, objDef_s::id, INVSH_GetItemByID(), requirement_s::link, requirements_s::links, technology_s::name, objDef_s::name, requirements_s::numLinks, requirement_s::typelink_t::od, OPTION_PRODUCTION_REQUIREMENTS, RS_GetTechForItem(), RS_LINK_ANTIMATTER, RS_LINK_ITEM, RS_LINK_TECH, RS_LINK_TECH_NOT, requirement_s::type, cgame_import_s::UI_AddOption(), va(), Vector4Copy, and yellow.
Referenced by PR_AircraftInfo(), and PR_ItemProductionInfo().
Show active production item in Base sections.
Definition at line 838 of file cp_produce_callbacks.cpp.
References B_GetFoundedBaseByIDX(), cgi, cgame_import_s::Cmd_Argv(), production_s::data, production_s::idx, production_queue_s::items, production_queue_s::numItems, PR_GetName(), PR_GetProductionForBase, PR_GetProgress, and PR_ProductionAllowed().
Definition at line 878 of file cp_produce_callbacks.cpp.
References cgi.
Referenced by CP_RemoveCampaignCallbackCommands().
update the list of queued and available items
[in] | base | Pointer to the base. |
UFOs at UFO stores
Definition at line 78 of file cp_produce_callbacks.cpp.
References _, AIR_CountInBaseByTemplate(), AIR_IsUFO, productionData_t::productionItem_t::aircraft, ccs_s::aircraftTemplates, production_s::amount, B_ItemInBase(), ccs, cgi, storedUFO_s::condition, csi, cgame_import_s::csi, productionData_t::data, production_s::data, DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, aircraft_s::getUfoType(), i, aircraft_s::id, technology_s::id, storedUFO_s::installation, objDef_s::isVirtual, productionData_t::productionItem_t::item, production_queue_s::items, aircraft_s::name, objDef_s::name, ccs_s::numAircraftTemplates, production_queue_s::numItems, csi_s::numODs, csi_s::ods, PR_GetProductionForBase, PR_IsAircraft, PR_IsDisassembly, PR_IsItem, PR_ItemIsProduceable(), produceCategory, technology_s::produceTime, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), SUFO_STORED, aircraft_s::tech, TEXT_PRODUCTION_AMOUNT, TEXT_PRODUCTION_LIST, TEXT_PRODUCTION_QUEUED, productionData_t::productionItem_t::ufo, UFO_TypeToName(), storedUFO_s::ufoTemplate, US_Foreach, US_UFOsInStorage(), and va().
Referenced by PR_ProductionDecrease_f(), PR_ProductionDown_f(), PR_ProductionIncrease_f(), PR_ProductionStop_f(), PR_ProductionType_f(), and PR_ProductionUp_f().
|
static |
Holds the current active production category/filter type.
Definition at line 40 of file cp_produce_callbacks.cpp.
Referenced by PR_ProductionInfo(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), and PR_UpdateProductionList().
|
static |
Definition at line 859 of file cp_produce_callbacks.cpp.
|
static |
A list if all producable items.
Definition at line 46 of file cp_produce_callbacks.cpp.
|
static |
Number of blank lines between queued items and tech list.
Definition at line 52 of file cp_produce_callbacks.cpp.
Referenced by PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), and PR_UpdateProductionList().
|
static |
Currently selected entry in the productionItemList (depends on content)
Definition at line 49 of file cp_produce_callbacks.cpp.
|
static |
Holds the current active selected queue entry.
Definition at line 43 of file cp_produce_callbacks.cpp.
Referenced by PR_ProductionDecrease_f(), PR_ProductionIncrease_f(), and PR_ProductionInfo().