UI: Suppress confusing reputation-earned dialog on augment install (#739)

This commit is contained in:
Michael Ficocelli 2023-08-28 15:12:13 -04:00 committed by GitHub
parent 9a0d688909
commit 62058a7f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 12 deletions

@ -154,6 +154,7 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
<br />- skill / experience
<br />- every server except home
<br />- factions and reputation
<br />- current work activity
<br />
<br />
You will keep:

@ -130,7 +130,7 @@ export function prestigeAugmentation(this: PlayerObject): void {
this.reapplyAllAugmentations(true);
this.hp.current = this.hp.max;
this.finishWork(true);
this.finishWork(true, true);
}
export function prestigeSourceFile(this: PlayerObject): void {

@ -15,9 +15,9 @@ export function processWork(this: PlayerObject, cycles = 1): void {
this.finishWork(false);
}
}
export function finishWork(this: PlayerObject, cancelled: boolean): void {
export function finishWork(this: PlayerObject, cancelled: boolean, suppressDialog?: boolean): void {
if (this.currentWork === null) return;
this.currentWork.finish(cancelled);
this.currentWork.finish(cancelled, !!suppressDialog);
this.currentWork = null;
this.focus = false;
}

@ -111,8 +111,8 @@ export class ClassWork extends Work {
return false;
}
finish(): void {
if (!this.singularity) {
finish(cancelled: boolean, suppressDialog?: boolean): void {
if (!this.singularity && !suppressDialog) {
dialogBoxCreate(
<>
After {this.getClass().youAreCurrently} for{" "}

@ -53,8 +53,8 @@ export class CompanyWork extends Work {
influenceStockThroughCompanyWork(company, gains.reputation, cycles);
return false;
}
finish(): void {
if (!this.singularity) {
finish(cancelled: boolean, suppressDialog?: boolean): void {
if (!this.singularity && !suppressDialog) {
dialogBoxCreate(
<>
You finished working for {this.companyName}

@ -73,14 +73,14 @@ export class CreateProgramWork extends Work {
}
return false;
}
finish(cancelled: boolean): void {
finish(cancelled: boolean, suppressDialog?: boolean): void {
const programName = asProgramFilePath(this.programName);
if (!cancelled) {
//Complete case
Player.gainIntelligenceExp(
(CONSTANTS.IntelligenceProgramBaseExpGain * this.cyclesWorked * CONSTANTS.MilliPerCycle) / 1000,
);
if (!this.singularity) {
if (!this.singularity && !suppressDialog) {
const lines = [
`You've finished creating ${programName}!`,
"The new program can be found on your home computer.",

@ -62,8 +62,8 @@ export class FactionWork extends Work {
return false;
}
finish(): void {
if (!this.singularity) {
finish(cancelled: boolean, suppressDialog?: boolean): void {
if (!this.singularity && !suppressDialog) {
dialogBoxCreate(
<>
You worked for {this.getFaction().name}.

@ -12,7 +12,7 @@ export abstract class Work {
}
abstract process(cycles: number): boolean;
abstract finish(cancelled: boolean): void;
abstract finish(cancelled: boolean, suppressDialog?: boolean): void;
abstract APICopy(): Record<string, unknown>;
abstract toJSON(): IReviverValue;
}