mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
merge dev
This commit is contained in:
@@ -8,11 +8,12 @@ import { Cities } from "./Cities";
|
||||
import { IMap } from "../types";
|
||||
|
||||
export function createCityMap<T>(initValue: T): IMap<T> {
|
||||
const map: IMap<any> = {};
|
||||
const map: IMap<T> = {};
|
||||
const cities = Object.keys(Cities);
|
||||
for (let i = 0; i < cities.length; ++i) {
|
||||
map[cities[i]] = initValue;
|
||||
}
|
||||
|
||||
return map;
|
||||
// round try JSON so to make sure none of the initial values have the same references.
|
||||
return JSON.parse(JSON.stringify(map));
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import { joinFaction } from "../../Faction/FactionHelpers";
|
||||
import { use } from "../../ui/Context";
|
||||
|
||||
import { dialogBoxCreate } from "../../ui/React/DialogBox";
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
|
||||
type IProps = {
|
||||
loc: Location;
|
||||
@@ -78,7 +79,7 @@ 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>;
|
||||
|
||||
Reference in New Issue
Block a user