mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
SLEEVES: Set to Idle in UI (#903)
This commit is contained in:
parent
e56e3dddf1
commit
2df04bc567
@ -69,11 +69,12 @@ export function SleeveElem(props: SleeveElemProps): React.ReactElement {
|
||||
const [travelOpen, setTravelOpen] = useState(false);
|
||||
const [augmentationsOpen, setAugmentationsOpen] = useState(false);
|
||||
|
||||
const [abc, setABC] = useState(["------", "------", "------"]);
|
||||
const [abc, setABC] = useState(["Idle", "------", "------"]);
|
||||
|
||||
function setTask(): void {
|
||||
switch (abc[0]) {
|
||||
case "------":
|
||||
case "Idle":
|
||||
props.sleeve.stopWork();
|
||||
break;
|
||||
case "Work for Company":
|
||||
if (getEnumHelper("CompanyName").isMember(abc[1])) props.sleeve.workForCompany(abc[1]);
|
||||
|
@ -113,7 +113,7 @@ function possibleContracts(sleeve: Sleeve): string[] {
|
||||
|
||||
const tasks: {
|
||||
[key: string]: undefined | ((sleeve: Sleeve) => ITaskDetails);
|
||||
["------"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
["Idle"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
["Work for Company"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
["Work for Faction"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
["Commit Crime"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
@ -123,7 +123,7 @@ const tasks: {
|
||||
["Shock Recovery"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
["Synchronize"]: (sleeve: Sleeve) => ITaskDetails;
|
||||
} = {
|
||||
"------": (): ITaskDetails => {
|
||||
Idle: (): ITaskDetails => {
|
||||
return { first: ["------"], second: () => ["------"] };
|
||||
},
|
||||
"Work for Company": (sleeve: Sleeve): ITaskDetails => {
|
||||
@ -219,7 +219,7 @@ const tasks: {
|
||||
|
||||
const canDo: {
|
||||
[key: string]: undefined | ((sleeve: Sleeve) => boolean);
|
||||
["------"]: (sleeve: Sleeve) => boolean;
|
||||
["Idle"]: (sleeve: Sleeve) => boolean;
|
||||
["Work for Company"]: (sleeve: Sleeve) => boolean;
|
||||
["Work for Faction"]: (sleeve: Sleeve) => boolean;
|
||||
["Commit Crime"]: (sleeve: Sleeve) => boolean;
|
||||
@ -229,7 +229,7 @@ const canDo: {
|
||||
["Shock Recovery"]: (sleeve: Sleeve) => boolean;
|
||||
["Synchronize"]: (sleeve: Sleeve) => boolean;
|
||||
} = {
|
||||
"------": () => true,
|
||||
Idle: () => true,
|
||||
"Work for Company": (sleeve: Sleeve) => possibleJobs(sleeve).length > 0,
|
||||
"Work for Faction": (sleeve: Sleeve) => possibleFactions(sleeve).length > 0,
|
||||
"Commit Crime": () => true,
|
||||
@ -243,7 +243,7 @@ const canDo: {
|
||||
|
||||
function getABC(sleeve: Sleeve): [string, string, string] {
|
||||
const work = sleeve.currentWork;
|
||||
if (work === null) return ["------", "------", "------"];
|
||||
if (work === null) return ["Idle", "------", "------"];
|
||||
switch (work.type) {
|
||||
case SleeveWorkType.COMPANY:
|
||||
return ["Work for Company", work.companyName, "------"];
|
||||
|
Loading…
Reference in New Issue
Block a user