Polish some UI

This commit is contained in:
nickofolas 2022-03-19 11:04:15 -05:00
parent fef5ab31b2
commit d2dd88c5ca
3 changed files with 62 additions and 48 deletions

@ -1372,7 +1372,7 @@ export function craftAugmentationWork(this: IPlayer, numCycles: number): boolean
export function finishCraftAugmentationWork(this: IPlayer, cancelled: boolean): string {
const augName = this.craftAugmentationName;
if (cancelled === false) {
dialogBoxCreate(`You've finished crafting ${augName}.<br>The augmentation has been grafted to you, but you feel slightly lightheaded.`)
dialogBoxCreate(`You've finished crafting ${augName}.<br>The augmentation has been grafted to your body, but you feel a bit off.`)
applyAugmentation(Augmentations[augName]);
} else {

@ -143,7 +143,9 @@ function Work(): React.ReactElement {
let details = <></>;
let header = <></>;
let innerText = <></>;
if (player.workType === CONSTANTS.WorkTypeCompanyPartTime || player.workType === CONSTANTS.WorkTypeCompany) {
switch (player.workType) {
case CONSTANTS.WorkTypeCompanyPartTime:
case CONSTANTS.WorkTypeCompany:
details = (
<>
{player.jobs[player.companyName]} at <strong>{player.companyName}</strong>
@ -159,7 +161,8 @@ function Work(): React.ReactElement {
+<Reputation reputation={player.workRepGained} /> rep
</>
);
} else if (player.workType === CONSTANTS.WorkTypeFaction) {
break;
case CONSTANTS.WorkTypeFaction:
details = (
<>
{player.factionWorkType} for <strong>{player.currentWorkFactionName}</strong>
@ -175,11 +178,13 @@ function Work(): React.ReactElement {
+<Reputation reputation={player.workRepGained} /> rep
</>
);
} else if (player.workType === CONSTANTS.WorkTypeStudyClass) {
break;
case CONSTANTS.WorkTypeStudyClass:
details = <>{player.workType}</>;
header = <>You are {player.className}</>;
innerText = <>{convertTimeMsToTimeElapsedString(player.timeWorked)}</>;
} else if (player.workType === CONSTANTS.WorkTypeCreateProgram) {
break;
case CONSTANTS.WorkTypeCreateProgram:
details = <>Coding {player.createProgramName}</>;
header = <>Creating a program</>;
innerText = (
@ -188,6 +193,16 @@ function Work(): React.ReactElement {
{((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}%
</>
);
break;
case CONSTANTS.WorkTypeCraftAugmentation:
details = <>Crafting {player.craftAugmentationName}</>;
header = <>Crafting an Augmentation</>;
innerText = (
<>
<strong>{convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorkedCraftAugmentation)}</strong>
{" "}remaining
</>
);
}
return (

@ -511,8 +511,7 @@ export function WorkInProgressRoot(): React.ReactElement {
<br /><br />
You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}
<br /><br />
The augumentation if {((player.timeWorkedCraftAugmentation / player.timeNeededToCompleteWork) * 100).toFixed(2)}
% complete. <br />
The augmentation will be done in {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorkedCraftAugmentation)}.<br />
If you cancel, your work will <b>not</b> be saved, and the money you spent will <b>not</b> be returned.
</Typography>
</Grid>