): void {
+ setName(event.target.value);
+ }
+
+ return (<>
+ Give your employee a nickname!
+
+
+ >);
+}
+
+interface IHireEmployeeProps {
+ employee: Employee;
+ office: OfficeSpace;
+ popupId: string;
+ player: IPlayer;
+ corp: ICorporation;
+}
+
+function HireEmployeeButton(props: IHireEmployeeProps): React.ReactElement {
+ function hire(): void {
+ const popupId = "cmpy-mgmt-name-employee-popup";
+ createPopup(popupId, NameEmployeePopup, {
+ office: props.office,
+ corp: props.corp,
+ popupId: popupId,
+ player: props.player,
+ employee: props.employee,
+ });
+ removePopup(props.popupId);
+ }
+
+ return (
+ Intelligence: {formatNumber(props.employee.int, 1)}
+ Charisma: {formatNumber(props.employee.cha, 1)}
+ Experience: {formatNumber(props.employee.exp, 1)}
+ Creativity: {formatNumber(props.employee.cre, 1)}
+ Efficiency: {formatNumber(props.employee.eff, 1)}
+ Salary: {numeralWrapper.formatMoney(props.employee.sal)} \ s
+
);
+}
+
+interface IProps {
+ office: OfficeSpace;
+ corp: ICorporation;
+ popupId: string;
+ player: IPlayer;
+}
+
+// Create a popup that lets the player manage exports
+export function HireEmployeePopup(props: IProps): React.ReactElement {
+ if (props.office.atCapacity()) return (<>>);
+
+ //Generate three random employees (meh, decent, amazing)
+ const mult1 = getRandomInt(25, 50)/100;
+ const mult2 = getRandomInt(51, 75)/100;
+ const mult3 = getRandomInt(76, 100)/100;
+ const int = getRandomInt(50, 100);
+ const cha = getRandomInt(50, 100);
+ const exp = getRandomInt(50, 100);
+ const cre = getRandomInt(50, 100);
+ const eff = getRandomInt(50, 100);
+ const sal = CorporationConstants.EmployeeSalaryMultiplier * (int + cha + exp + cre + eff);
+
+ const emp1 = new Employee({
+ intelligence: int * mult1,
+ charisma: cha * mult1,
+ experience: exp * mult1,
+ creativity: cre * mult1,
+ efficiency: eff * mult1,
+ salary: sal * mult1,
+ });
+
+ const emp2 = new Employee({
+ intelligence: int * mult2,
+ charisma: cha * mult2,
+ experience: exp * mult2,
+ creativity: cre * mult2,
+ efficiency: eff * mult2,
+ salary: sal * mult2,
+ });
+
+ const emp3 = new Employee({
+ intelligence: int * mult3,
+ charisma: cha * mult3,
+ experience: exp * mult3,
+ creativity: cre * mult3,
+ efficiency: eff * mult3,
+ salary: sal * mult3,
+ });
+
+ return (<>
+ Select one of the following candidates for hire:
+
+
+
+ >);
+}
diff --git a/src/Corporation/ui/IndustryOffice.tsx b/src/Corporation/ui/IndustryOffice.tsx
index faa35b039..fa09e3a12 100644
--- a/src/Corporation/ui/IndustryOffice.tsx
+++ b/src/Corporation/ui/IndustryOffice.tsx
@@ -11,6 +11,7 @@ import { numeralWrapper } from "../../ui/numeralFormat";
import { getSelectText } from "../../../utils/uiHelpers/getSelectData";
import { createPopup } from "../../ui/React/createPopup";
import { UpgradeOfficeSizePopup } from "./UpgradeOfficeSizePopup";
+import { HireEmployeePopup } from "./HireEmployeePopup";
import { ThrowPartyPopup } from "./ThrowPartyPopup";
import { ICorporation } from "../ICorporation";
import { IPlayer } from "../../PersonObjects/IPlayer";
@@ -550,7 +551,6 @@ export function IndustryOffice(props: IProps): React.ReactElement {
)
}
- const corp = props.corp;
const division = props.routing.currentDivision; // Validated in constructor
if(division === null) return (<>>);
const office = division.offices[props.currentCity]; // Validated in constructor
@@ -570,9 +570,15 @@ export function IndustryOffice(props: IProps): React.ReactElement {
}
}
- function hireEmployeeButtonOnClick(): void {
+ function openHireEmployeePopup(): void {
if(office === 0) return;
- office.findEmployees(props.player, corp);
+ const popupId = "cmpy-mgmt-hire-employee-popup";
+ createPopup(popupId, HireEmployeePopup, {
+ office: office,
+ corp: props.corp,
+ popupId: popupId,
+ player: props.player,
+ });
}
// Autohire employee button
@@ -614,7 +620,7 @@ export function IndustryOffice(props: IProps): React.ReactElement {
Office Space
Size: {office.employees.length} / {office.size} employees
-