SLEEVES: Set to Idle in UI (#903)

This commit is contained in:
Sphyxis 2023-11-03 19:01:53 -06:00 committed by GitHub
parent e56e3dddf1
commit 2df04bc567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

@ -69,11 +69,12 @@ export function SleeveElem(props: SleeveElemProps): React.ReactElement {
const [travelOpen, setTravelOpen] = useState(false); const [travelOpen, setTravelOpen] = useState(false);
const [augmentationsOpen, setAugmentationsOpen] = useState(false); const [augmentationsOpen, setAugmentationsOpen] = useState(false);
const [abc, setABC] = useState(["------", "------", "------"]); const [abc, setABC] = useState(["Idle", "------", "------"]);
function setTask(): void { function setTask(): void {
switch (abc[0]) { switch (abc[0]) {
case "------": case "Idle":
props.sleeve.stopWork();
break; break;
case "Work for Company": case "Work for Company":
if (getEnumHelper("CompanyName").isMember(abc[1])) props.sleeve.workForCompany(abc[1]); if (getEnumHelper("CompanyName").isMember(abc[1])) props.sleeve.workForCompany(abc[1]);

@ -113,7 +113,7 @@ function possibleContracts(sleeve: Sleeve): string[] {
const tasks: { const tasks: {
[key: string]: undefined | ((sleeve: Sleeve) => ITaskDetails); [key: string]: undefined | ((sleeve: Sleeve) => ITaskDetails);
["------"]: (sleeve: Sleeve) => ITaskDetails; ["Idle"]: (sleeve: Sleeve) => ITaskDetails;
["Work for Company"]: (sleeve: Sleeve) => ITaskDetails; ["Work for Company"]: (sleeve: Sleeve) => ITaskDetails;
["Work for Faction"]: (sleeve: Sleeve) => ITaskDetails; ["Work for Faction"]: (sleeve: Sleeve) => ITaskDetails;
["Commit Crime"]: (sleeve: Sleeve) => ITaskDetails; ["Commit Crime"]: (sleeve: Sleeve) => ITaskDetails;
@ -123,7 +123,7 @@ const tasks: {
["Shock Recovery"]: (sleeve: Sleeve) => ITaskDetails; ["Shock Recovery"]: (sleeve: Sleeve) => ITaskDetails;
["Synchronize"]: (sleeve: Sleeve) => ITaskDetails; ["Synchronize"]: (sleeve: Sleeve) => ITaskDetails;
} = { } = {
"------": (): ITaskDetails => { Idle: (): ITaskDetails => {
return { first: ["------"], second: () => ["------"] }; return { first: ["------"], second: () => ["------"] };
}, },
"Work for Company": (sleeve: Sleeve): ITaskDetails => { "Work for Company": (sleeve: Sleeve): ITaskDetails => {
@ -219,7 +219,7 @@ const tasks: {
const canDo: { const canDo: {
[key: string]: undefined | ((sleeve: Sleeve) => boolean); [key: string]: undefined | ((sleeve: Sleeve) => boolean);
["------"]: (sleeve: Sleeve) => boolean; ["Idle"]: (sleeve: Sleeve) => boolean;
["Work for Company"]: (sleeve: Sleeve) => boolean; ["Work for Company"]: (sleeve: Sleeve) => boolean;
["Work for Faction"]: (sleeve: Sleeve) => boolean; ["Work for Faction"]: (sleeve: Sleeve) => boolean;
["Commit Crime"]: (sleeve: Sleeve) => boolean; ["Commit Crime"]: (sleeve: Sleeve) => boolean;
@ -229,7 +229,7 @@ const canDo: {
["Shock Recovery"]: (sleeve: Sleeve) => boolean; ["Shock Recovery"]: (sleeve: Sleeve) => boolean;
["Synchronize"]: (sleeve: Sleeve) => boolean; ["Synchronize"]: (sleeve: Sleeve) => boolean;
} = { } = {
"------": () => true, Idle: () => true,
"Work for Company": (sleeve: Sleeve) => possibleJobs(sleeve).length > 0, "Work for Company": (sleeve: Sleeve) => possibleJobs(sleeve).length > 0,
"Work for Faction": (sleeve: Sleeve) => possibleFactions(sleeve).length > 0, "Work for Faction": (sleeve: Sleeve) => possibleFactions(sleeve).length > 0,
"Commit Crime": () => true, "Commit Crime": () => true,
@ -243,7 +243,7 @@ const canDo: {
function getABC(sleeve: Sleeve): [string, string, string] { function getABC(sleeve: Sleeve): [string, string, string] {
const work = sleeve.currentWork; const work = sleeve.currentWork;
if (work === null) return ["------", "------", "------"]; if (work === null) return ["Idle", "------", "------"];
switch (work.type) { switch (work.type) {
case SleeveWorkType.COMPANY: case SleeveWorkType.COMPANY:
return ["Work for Company", work.companyName, "------"]; return ["Work for Company", work.companyName, "------"];