Header file for menu callback functions used for hire/employee menu. More...
#include "../cl_shared.h"
#include "../cl_team.h"
#include "../ui/ui_main.h"
#include "../ui/ui_data.h"
#include "../ui/ui_draw.h"
#include "cp_campaign.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. | |
static void | E_EmployeeSelect (employee_t *employee) |
static void | E_EmployeeListScroll_f (void) |
Click function for employee_list node. | |
static void | E_EmployeeList_f (void) |
Will fill the list with employees. | |
static void | E_ChangeName_f (void) |
Change the name of the selected actor. | |
int | E_GenerateHiredEmployeesList (const base_t *base) |
Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred). | |
employee_t * | E_GetEmployeeByMenuIndex (int num) |
Find an hired or free employee by the menu index. | |
static void | E_EmployeeDelete_f (void) |
This removes an employee from the global list so that he/she is no longer hireable. | |
static void | E_EmployeeHire_f (void) |
Callback for employee_hire command. | |
static void | E_EmployeeSelect_f (void) |
Callback function that updates the character cvars when calling employee_select. | |
void | E_InitCallbacks (void) |
void | E_ShutdownCallbacks (void) |
Variables | |
static employee_t * | selectedEmployee = NULL |
static int | employeeCategory = 0 |
static const int | maxEmployeesPerPage = 15 |
static int | employeeScrollPos = 0 |
linkedList_t * | employeeList |
int | employeesInCurrentList |
Header file for menu callback functions used for hire/employee menu.
Definition in file cp_employee_callbacks.c.
static void E_ChangeName_f | ( | void | ) | [static] |
Change the name of the selected actor.
Definition at line 219 of file cp_employee_callbacks.c.
References employee_s::chr, Cvar_GetInteger(), Cvar_GetString(), E_GetEmployeeFromChrUCN(), character_s::name, and Q_strncpyz().
Referenced by E_InitCallbacks().
static void E_EmployeeDelete_f | ( | void | ) | [static] |
This removes an employee from the global list so that he/she is no longer hireable.
Definition at line 253 of file cp_employee_callbacks.c.
References _, Cbuf_AddText(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, E_DeleteEmployee(), E_GetEmployeeByMenuIndex(), E_IsHired, E_UnhireEmployee(), employeeCategory, employeeScrollPos, employee_s::type, UI_DisplayNotice(), and va().
Referenced by E_InitCallbacks().
static void E_EmployeeHire_f | ( | void | ) | [static] |
Callback for employee_hire command.
maxEmployeesPerPage
are possible Definition at line 288 of file cp_employee_callbacks.c.
References _, B_GetCurrentSelectedBase(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, E_EmployeeSelect(), E_GetEmployeeByMenuIndex(), E_HireEmployee(), E_IsHired, E_UnhireEmployee(), E_UpdateGUICount_f(), employeeScrollPos, UI_DisplayNotice(), and UI_ExecuteConfunc().
Referenced by E_InitCallbacks().
static void E_EmployeeList_f | ( | void | ) | [static] |
Will fill the list with employees.
Definition at line 142 of file cp_employee_callbacks.c.
References B_GetCurrentSelectedBase(), employee_s::chr, Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_Set(), E_EmployeeSelect(), E_GetEmployeeByMenuIndex(), E_GetNext(), E_IsHired, E_IsInBase(), EMPL_PILOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, employeeCategory, employeesInCurrentList, LIST_AddPointer(), LIST_Delete(), MAX_EMPL, character_s::name, TEXT_LIST, UI_ExecuteConfunc(), UI_RegisterLinkedListText(), and UI_ResetData().
Referenced by E_InitCallbacks().
static void E_EmployeeListScroll_f | ( | void | ) | [static] |
Click function for employee_list node.
Definition at line 91 of file cp_employee_callbacks.c.
References B_GetCurrentSelectedBase(), Cmd_Argc(), Cmd_Argv(), Cvar_Set(), E_GetNext(), E_IsHired, E_IsInBase(), employeeCategory, employeeScrollPos, maxEmployeesPerPage, UI_ExecuteConfunc(), and va().
Referenced by E_InitCallbacks().
static void E_EmployeeSelect | ( | employee_t * | employee | ) | [static] |
Definition at line 69 of file cp_employee_callbacks.c.
References B_GetCurrentSelectedBase(), employee_s::chr, CL_UpdateCharacterValues(), Cvar_SetValue(), E_IsHired, and character_s::ucn.
Referenced by E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().
static void E_EmployeeSelect_f | ( | void | ) | [static] |
Callback function that updates the character cvars when calling employee_select.
Definition at line 347 of file cp_employee_callbacks.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), E_EmployeeSelect(), E_GetEmployeeByMenuIndex(), and employeesInCurrentList.
Referenced by E_InitCallbacks().
int E_GenerateHiredEmployeesList | ( | const base_t * | base | ) |
Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred).
Definition at line 231 of file cp_employee_callbacks.c.
References E_GetHiredEmployees(), EMPL_SOLDIER, and employeesInCurrentList.
Referenced by AIR_AssignInitial().
employee_t* E_GetEmployeeByMenuIndex | ( | int | num | ) |
Find an hired or free employee by the menu index.
[in] | num | The index from the hire menu screen (index inemployeeList). |
Definition at line 243 of file cp_employee_callbacks.c.
References LIST_GetByIdx().
Referenced by AIM_AddEmployeeFromMenu(), CL_ActorPilotSelect_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().
void E_InitCallbacks | ( | void | ) |
Definition at line 364 of file cp_employee_callbacks.c.
References Cmd_AddCommand(), E_ChangeName_f(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_EmployeeSelect_f(), and E_UpdateGUICount_f().
Referenced by CP_AddCampaignCallbackCommands().
void E_ShutdownCallbacks | ( | void | ) |
Definition at line 377 of file cp_employee_callbacks.c.
References Cmd_RemoveCommand().
Referenced by CP_RemoveCampaignCallbackCommands().
static void E_UpdateGUICount_f | ( | void | ) | [static] |
Update GUI with the current number of employee per category.
Definition at line 53 of file cp_employee_callbacks.c.
References B_GetCurrentSelectedBase(), CAP_EMPLOYEES, base_s::capacities, Cvar_Set(), Cvar_SetValue(), E_CountAllHired(), E_CountHired(), EMPL_PILOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, cap_maxcur_s::max, and va().
Referenced by E_EmployeeHire_f(), and E_InitCallbacks().
int employeeCategory = 0 [static] |
Definition at line 38 of file cp_employee_callbacks.c.
Referenced by E_EmployeeDelete_f(), E_EmployeeList_f(), and E_EmployeeListScroll_f().
Definition at line 45 of file cp_employee_callbacks.c.
int employeeScrollPos = 0 [static] |
Definition at line 42 of file cp_employee_callbacks.c.
Referenced by E_EmployeeDelete_f(), E_EmployeeHire_f(), and E_EmployeeListScroll_f().
Definition at line 48 of file cp_employee_callbacks.c.
Referenced by CL_UpdateEmployeeList(), E_EmployeeList_f(), E_EmployeeSelect_f(), and E_GenerateHiredEmployeesList().
const int maxEmployeesPerPage = 15 [static] |
Definition at line 40 of file cp_employee_callbacks.c.
Referenced by E_EmployeeListScroll_f().
employee_t* selectedEmployee = NULL [static] |
Currently selected employee.
Definition at line 36 of file cp_employee_callbacks.c.