UFO: Alien Invasion
|
Header file for menu callback functions used for hire/employee menu. More...
#include "../../cl_shared.h"
#include "../../ui/ui_dataids.h"
#include "cp_campaign.h"
#include "cp_hospital.h"
#include "cp_employee_callbacks.h"
#include "cp_employee.h"
Go to the source code of this file.
Functions | |
static void | E_UpdateGUICount_f (void) |
Update GUI with the current number of employee per category. More... | |
static void | E_EmployeeSelect (Employee *employee) |
static Employee * | E_GetEmployeeByMenuIndex (int num) |
Find an hired or free employee by the menu index. More... | |
static void | E_EmployeeList_f (void) |
Will fill the list with employees. More... | |
static void | E_ChangeName_f (void) |
Change the name of the selected actor. More... | |
static void | E_EmployeeDelete_f (void) |
This removes an employee from the global list so that he/she is no longer hireable. More... | |
static void | E_EmployeeHire_f (void) |
Callback for employee_hire command. More... | |
static void | E_EmployeeSelect_f (void) |
Callback function that updates the character cvars when calling employee_select. More... | |
static const char * | E_GetEmployeeTypeString (employeeType_t type) |
Convert employeeType_t to string id. More... | |
static void | E_GetCounts_f (void) |
Returns the number of employees hired on a base for the UI. More... | |
void | E_InitCallbacks (void) |
Register UI callbacks. More... | |
void | E_ShutdownCallbacks (void) |
Unregister UI callbacks. More... | |
Variables | |
static Employee * | selectedEmployee = nullptr |
static int | employeeCategory = 0 |
static linkedList_t * | employeeList |
static int | employeesInCurrentList |
static const cmdList_t | employeeCmds [] |
List of UI command callbacks. More... | |
Header file for menu callback functions used for hire/employee menu.
Definition in file cp_employee_callbacks.cpp.
Change the name of the selected actor.
Definition at line 175 of file cp_employee_callbacks.cpp.
References cgi, Employee::chr, Com_IsValidName(), cgame_import_s::Cvar_ForceSet(), cgame_import_s::Cvar_GetString(), E_GetEmployeeFromChrUCN(), character_s::name, and Q_strncpyz().
This removes an employee from the global list so that he/she is no longer hireable.
Definition at line 194 of file cp_employee_callbacks.cpp.
References _, cgi, cgame_import_s::Cmd_Argv(), DEBUG_CLIENT, E_DeleteEmployee(), E_GetEmployeeByMenuIndex(), and employeeCategory.
Callback for employee_hire command.
maxEmployeesPerPage
are possible Definition at line 232 of file cp_employee_callbacks.cpp.
References _, B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), DEBUG_CLIENT, E_EmployeeSelect(), E_GetEmployeeByMenuIndex(), E_HireEmployee(), E_UpdateGUICount_f(), Employee::isHired(), and Employee::unhire().
Will fill the list with employees.
Definition at line 92 of file cp_employee_callbacks.cpp.
References AIR_IsEmployeeInAircraft(), B_GetCurrentSelectedBase(), cgi, cgame_import_s::Cmd_Argv(), cgame_import_s::Cvar_Set(), E_EmployeeSelect(), E_Foreach, E_GetEmployeeByMenuIndex(), EMPL_PILOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, employeeCategory, employeesInCurrentList, HOS_NeedsHealing(), MAX_EMPL, aircraft_s::name, and selectedEmployee.
Definition at line 61 of file cp_employee_callbacks.cpp.
References B_GetCurrentSelectedBase(), cgi, Employee::chr, Employee::isHired(), and character_s::ucn.
Referenced by E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().
Callback function that updates the character cvars when calling employee_select.
Definition at line 282 of file cp_employee_callbacks.cpp.
References cgi, cgame_import_s::Cmd_Argv(), E_EmployeeSelect(), E_GetEmployeeByMenuIndex(), and employeesInCurrentList.
Returns the number of employees hired on a base for the UI.
Definition at line 323 of file cp_employee_callbacks.cpp.
References B_GetFoundedBaseByIDX(), cgi, cgame_import_s::Cmd_Argv(), count, E_CountHired(), E_GetEmployeeString(), E_GetEmployeeTypeString(), EMPL_ROBOT, EMPL_SOLDIER, MAX_VAR, Q_strncpyz(), and type.
Find an hired or free employee by the menu index.
[in] | num | The index from the hire menu screen (index inemployeeList). |
Definition at line 83 of file cp_employee_callbacks.cpp.
References cgi, and cgame_import_s::LIST_GetByIdx().
Referenced by E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().
|
static |
Convert employeeType_t to string id.
type | employeeType_t value |
Definition at line 302 of file cp_employee_callbacks.cpp.
References cgi, EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, and ERR_DROP.
Referenced by E_GetCounts_f().
Register UI callbacks.
Definition at line 368 of file cp_employee_callbacks.cpp.
References cgi.
Referenced by E_InitStartup().
Unregister UI callbacks.
Definition at line 376 of file cp_employee_callbacks.cpp.
References cgi.
Referenced by E_Shutdown().
Update GUI with the current number of employee per category.
Definition at line 46 of file cp_employee_callbacks.cpp.
References B_GetCurrentSelectedBase(), CAP_EMPLOYEES, CAP_GetMax, cgi, cgame_import_s::Cvar_Set(), E_CountAllHired(), E_CountHired(), EMPL_PILOT, EMPL_SCIENTIST, EMPL_SOLDIER, and EMPL_WORKER.
Referenced by E_EmployeeHire_f().
|
static |
Definition at line 35 of file cp_employee_callbacks.cpp.
Referenced by E_EmployeeDelete_f(), and E_EmployeeList_f().
|
static |
List of UI command callbacks.
Definition at line 353 of file cp_employee_callbacks.cpp.
|
static |
Definition at line 38 of file cp_employee_callbacks.cpp.
|
static |
Definition at line 40 of file cp_employee_callbacks.cpp.
Referenced by E_EmployeeList_f(), and E_EmployeeSelect_f().
Currently selected employee.
Definition at line 33 of file cp_employee_callbacks.cpp.
Referenced by E_EmployeeList_f().