|
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. | |
| static void | PR_ClearSelected (void) |
| Resets all "selected" pointers to nullptr. | |
| static void | PR_UpdateProductionList (const base_t *base) |
| update the list of queued and available items | |
| 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. | |
| static void | PR_DisassemblyInfo (const storedUFO_t *ufo, int remainingHours) |
| Prints information about the selected disassembly task. | |
| static void | PR_AircraftInfo (const base_t *base, const aircraft_t *aircraftTemplate, int remainingHours) |
| Prints information about the selected aircraft in production. | |
| static void | PR_ProductionInfo (const base_t *base) |
| Prints information about the selected item in production. | |
| static void | PR_ProductionListRightClick_f (void) |
| Click function for production list. | |
| static void | PR_ProductionListClick_f (void) |
| Click function for production list. | |
| static void | PR_ProductionType_f (void) |
| Will select a new tab on the production list. | |
| static void | PR_ProductionList_f (void) |
| Will fill the list of producible items. | |
| static void | PR_ProductionIncrease_f (void) |
| Increases the production amount by given parameter. | |
| static void | PR_ProductionStop_f (void) |
| Stops the current running production. | |
| static void | PR_ProductionDecrease_f (void) |
| Decrease the production amount by given parameter. | |
| static void | PR_ProductionChange_f (void) |
| Change the production amount by given diff. | |
| static void | PR_ProductionUp_f (void) |
| shift the current production up the list | |
| static void | PR_ProductionDown_f (void) |
| shift the current production down the list | |
| static void | PR_ShowActiveProduction_f (void) |
| Show active production item in Base sections. | |
| 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. | |
| 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(), aircraft_t::id, aircraft_t::name, PR_GetPrice(), PR_RequirementsInfo(), aircraft_t::productionCost, Q_strcat(), aircraft_t::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(), and selectedProduction.
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 selectedData.
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_t::comp, COMP_ITEMCOUNT_SCALED, storedUFO_t::condition, aircraft_t::getUfoType(), i, storedUFO_t::id, storedUFO_t::installation, installation_t::name, objDef_t::name, Q_strcat(), TEXT_PRODUCTION_INFO, UFO_TypeToName(), and storedUFO_t::ufoTemplate.
Referenced by PR_ProductionInfo().
Definition at line 873 of file cp_produce_callbacks.cpp.
References cgi, and productionCallbacks.
Referenced by CP_AddCampaignCallbackCommands().
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(), objDef_t::id, objDef_t::name, requirements_t::numLinks, PR_GetPrice(), PR_ItemIsProduceable(), PR_RequirementsInfo(), objDef_t::productionCost, Q_strcat(), technology_t::requireForProduction, RS_GetTechForItem(), objDef_t::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, PR_IsDataValid, selectedData, and selectedProduction.
Decrease the production amount by given parameter.
Definition at line 737 of file cp_produce_callbacks.cpp.
References production_t::amount, B_GetCurrentSelectedBase(), cgi, 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_queue_t::items, production_queue_t::numItems, PR_GetProductionForBase, PR_QueueMove(), PR_UpdateProductionList(), and selectedProduction.
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_t::amount, B_GetCurrentSelectedBase(), CAP_GetFreeCapacity(), cgi, Com_sprintf(), cp_messageBuffer, CP_Popup(), production_t::data, productionData_t::data, 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_t::requireForProduction, selectedData, 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, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, CAP_GetFreeCapacity(), CAP_GetMax, CAP_ITEMS, CAP_WORKSPACE, cgi, production_t::data, productionData_t::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, selectedData, 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, 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, DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, production_queue_t::items, production_queue_t::numItems, PR_ClearSelected(), PR_GetProductionForBase, PR_ItemIsProduceable(), PR_ProductionInfo(), PR_SetData, produceCategory, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, productionItemList, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), selectedData, selectedProduction, and aircraft_t::tech.
Click function for production list.
Definition at line 391 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_t::data, DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, technology_t::id, production_queue_t::items, production_queue_t::numItems, PR_ClearSelected(), PR_GetProductionForBase, PR_GetTech(), PR_SetData, produceCategory, PRODUCTION_TYPE_ITEM, productionItemList, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), selectedData, selectedProduction, aircraft_t::tech, storedUFO_t::ufoTemplate, and UP_OpenWith().
Stops the current running production.
Definition at line 708 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_queue_t::items, production_queue_t::numItems, PR_GetProductionForBase, PR_ProductionInfo(), PR_QueueDelete(), PR_UpdateProductionList(), and selectedProduction.
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, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, FILTER_S_PRIMARY, MAX_FILTERTYPES, production_queue_t::numItems, PR_ClearSelectedItems(), PR_GetProductionForBase, PR_ProductionInfo(), PR_SetData, PR_UpdateProductionList(), produceCategory, PRODUCTION_TYPE_AIRCRAFT, PRODUCTION_TYPE_DISASSEMBLY, PRODUCTION_TYPE_ITEM, productionItemList, QUEUE_SPACERS, selectedData, and selectedProduction.
shift the current production up the list
Definition at line 792 of file cp_produce_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, production_queue_t::items, PR_GetProductionForBase, PR_QueueMove(), PR_UpdateProductionList(), and selectedProduction.
|
static |
Definition at line 189 of file cp_produce_callbacks.cpp.
References _, requirement_t::amount, ANTIMATTER_ITEM_ID, B_AntimatterInBase(), B_ItemInBase(), cgi, uiNode_t::color, uiNode_t::firstChild, green, i, INVSH_GetItemByID(), requirement_t::link, requirements_t::links, technology_t::name, requirements_t::numLinks, requirement_t::typelink_t::od, OPTION_PRODUCTION_REQUIREMENTS, RS_GetTechForItem(), RS_LINK_ANTIMATTER, RS_LINK_ITEM, RS_LINK_TECH, RS_LINK_TECH_NOT, requirement_t::type, 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, production_t::data, production_t::idx, production_queue_t::items, production_queue_t::numItems, PR_GetName(), PR_GetProductionForBase, PR_GetProgress, and PR_ProductionAllowed().
Definition at line 878 of file cp_produce_callbacks.cpp.
References cgi, and productionCallbacks.
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, production_t::amount, B_ItemInBase(), ccs, cgi, storedUFO_t::condition, csi, production_t::data, productionData_t::data, DEBUG_CLIENT, FILTER_AIRCRAFT, FILTER_DISASSEMBLY, aircraft_t::getUfoType(), i, aircraft_t::id, storedUFO_t::installation, objDef_t::isVirtual, productionData_t::productionItem_t::item, production_queue_t::items, aircraft_t::name, objDef_t::name, production_queue_t::numItems, PR_GetProductionForBase, PR_IsAircraft, PR_IsDisassembly, PR_IsItem, PR_ItemIsProduceable(), produceCategory, productionItemList, QUEUE_SPACERS, RS_GetTechForItem(), RS_IsResearched_ptr(), SUFO_STORED, aircraft_t::tech, TEXT_PRODUCTION_AMOUNT, TEXT_PRODUCTION_LIST, TEXT_PRODUCTION_QUEUED, productionData_t::productionItem_t::ufo, UFO_TypeToName(), storedUFO_t::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.
Referenced by PR_InitCallbacks(), and PR_ShutdownCallbacks().
|
static |
A list if all producable items.
Definition at line 46 of file cp_produce_callbacks.cpp.
Referenced by PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionType_f(), and PR_UpdateProductionList().
|
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.
Referenced by PR_ClearSelectedItems(), PR_ProductionChange_f(), PR_ProductionIncrease_f(), PR_ProductionInfo(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), and PR_ProductionType_f().
|
static |
Holds the current active selected queue entry.
Definition at line 43 of file cp_produce_callbacks.cpp.
Referenced by PR_ClearSelected(), PR_ProductionChange_f(), PR_ProductionDecrease_f(), PR_ProductionDown_f(), PR_ProductionIncrease_f(), PR_ProductionInfo(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionStop_f(), PR_ProductionType_f(), and PR_ProductionUp_f().