mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Toasts for Noodles Eaten, Hospitalized.
This commit is contained in:
parent
ffc8133fb8
commit
4f7199c0bd
@ -20,6 +20,8 @@ import { createRandomIp } from "../utils/IPAddress";
|
||||
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
||||
|
||||
|
||||
|
||||
interface IConstructorParams {
|
||||
adminRights?: boolean;
|
||||
hostname: string;
|
||||
|
@ -21,6 +21,7 @@ import { LocationName } from "../data/LocationNames";
|
||||
import { use } from "../../ui/Context";
|
||||
|
||||
import { dialogBoxCreate } from "../../ui/React/DialogBox";
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
|
||||
type IProps = {
|
||||
loc: Location;
|
||||
@ -75,8 +76,8 @@ export function SpecialLocation(props: IProps): React.ReactElement {
|
||||
|
||||
function renderNoodleBar(): React.ReactElement {
|
||||
function EatNoodles(): void {
|
||||
dialogBoxCreate(<>You ate some delicious noodles and feel refreshed.</>);
|
||||
}
|
||||
SnackbarEvents.emit("You ate some delicious noodles and feel refreshed", "success");
|
||||
}
|
||||
|
||||
return <Button onClick={EatNoodles}>Eat noodles</Button>;
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ import { Money } from "../../ui/React/Money";
|
||||
|
||||
import React from "react";
|
||||
import { serverMetadata } from "../../Server/data/servers";
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
|
||||
export function init(this: IPlayer): void {
|
||||
/* Initialize Player's home computer */
|
||||
@ -1697,13 +1698,7 @@ export function regenerateHp(this: IPlayer, amt: number): void {
|
||||
export function hospitalize(this: IPlayer): number {
|
||||
const cost = getHospitalizationCost(this);
|
||||
if (Settings.SuppressHospitalizationPopup === false) {
|
||||
dialogBoxCreate(
|
||||
<>
|
||||
You were in critical condition! You were taken to the hospital where luckily they were able to save your life.
|
||||
You were charged
|
||||
<Money money={cost} />
|
||||
</>,
|
||||
);
|
||||
SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, "warning");
|
||||
}
|
||||
|
||||
this.loseMoney(cost);
|
||||
|
Loading…
Reference in New Issue
Block a user