the world map is used every place a travel is done

This commit is contained in:
Olivier Gagnon
2021-09-09 22:06:59 -04:00
parent d5c9306395
commit 7f1d39a298
5 changed files with 78 additions and 60 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ import { SleeveTaskType } from "../SleeveTaskTypesEnum";
import { SleeveFaq } from "../data/SleeveFaq";
import { IPlayer } from "../../IPlayer";
import { CONSTANTS } from "../../../Constants";
import { Faction } from "../../../Faction/Faction";
import { Factions } from "../../../Faction/Factions";
@@ -201,8 +202,13 @@ export function SleeveElem(props: IProps): React.ReactElement {
<button className="std-button" onClick={openMoreStats}>
More Stats
</button>
<button className="std-button" onClick={openTravel}>
<button
className={`std-button${props.player.money.lt(CONSTANTS.TravelCost) ? " tooltip" : ""}`}
onClick={openTravel}
disabled={props.player.money.lt(CONSTANTS.TravelCost)}
>
Travel
{props.player.money.lt(CONSTANTS.TravelCost) && <span className="tooltiptext">Not enough money</span>}
</button>
<button
className={`std-button${props.sleeve.shock < 100 ? " tooltip" : ""}`}
+2 -7
View File
@@ -5,6 +5,7 @@ import { CONSTANTS } from "../../../Constants";
import { Cities } from "../../../Locations/Cities";
import { removePopup } from "../../../ui/React/createPopup";
import { Money } from "../../../ui/React/Money";
import { WorldMap } from "../../../ui/React/WorldMap";
import { CityName } from "../../../Locations/data/CityNames";
import { dialogBoxCreate } from "../../../../utils/DialogBox";
@@ -34,13 +35,7 @@ export function TravelPopup(props: IProps): React.ReactElement {
study. Traveling to a different city costs <Money money={CONSTANTS.TravelCost} player={props.player} />. It will
also set your current sleeve task to idle.
</p>
{Object.keys(Cities)
.filter((city: string) => props.sleeve.city !== city)
.map((city: string) => (
<div key={city} className="cmpy-mgmt-find-employee-option" onClick={() => travel(city)}>
{city}
</div>
))}
<WorldMap currentCity={props.sleeve.city} onTravel={(city: CityName) => travel(city)} />
</>
);
}