From 7f1d39a298b61985c6fd2650bf8e658d1d76419b Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 9 Sep 2021 22:06:59 -0400 Subject: [PATCH] the world map is used every place a travel is done --- src/Bladeburner/ui/TravelPopup.tsx | 12 +--- src/Locations/ui/TravelAgencyLocation.tsx | 45 +-------------- src/PersonObjects/Sleeve/ui/SleeveElem.tsx | 8 ++- src/PersonObjects/Sleeve/ui/TravelPopup.tsx | 9 +-- src/ui/React/WorldMap.tsx | 64 +++++++++++++++++++++ 5 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 src/ui/React/WorldMap.tsx diff --git a/src/Bladeburner/ui/TravelPopup.tsx b/src/Bladeburner/ui/TravelPopup.tsx index ed14f0d69..ad0624021 100644 --- a/src/Bladeburner/ui/TravelPopup.tsx +++ b/src/Bladeburner/ui/TravelPopup.tsx @@ -2,6 +2,8 @@ import React from "react"; import { removePopup } from "../../ui/React/createPopup"; import { BladeburnerConstants } from "../data/Constants"; import { IBladeburner } from "../IBladeburner"; +import { WorldMap } from "../../ui/React/WorldMap"; +import { CityName } from "../../Locations/data/CityNames"; interface IProps { bladeburner: IBladeburner; @@ -20,15 +22,7 @@ export function TravelPopup(props: IProps): React.ReactElement { Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in for your Bladeburner duties does not affect your location in the game otherwise.

- {BladeburnerConstants.CityNames.map((city) => { - // Reusing this css class...it adds a border and makes it - // so that background color changes when you hover - return ( -
travel(city)}> - {city} -
- ); - })} + travel(city)} /> ); } diff --git a/src/Locations/ui/TravelAgencyLocation.tsx b/src/Locations/ui/TravelAgencyLocation.tsx index b2819abab..cdf79f9cd 100644 --- a/src/Locations/ui/TravelAgencyLocation.tsx +++ b/src/Locations/ui/TravelAgencyLocation.tsx @@ -14,6 +14,7 @@ import { Settings } from "../../Settings/Settings"; import { StdButton } from "../../ui/React/StdButton"; import { Money } from "../../ui/React/Money"; +import { WorldMap } from "../../ui/React/WorldMap"; type IProps = { p: IPlayer; @@ -33,27 +34,6 @@ export class TravelAgencyLocation extends React.Component { } asciiWorldMap(): React.ReactNode { - const LocationLetter = (props: any): JSX.Element => { - if (props.city !== this.props.p.city) { - return ( - - {props.city} - {props.city[0]} - - ); - } - return {props.city[0]}; - }; - // map needs all this whitespace! // prettier-ignore return ( @@ -62,28 +42,7 @@ export class TravelAgencyLocation extends React.Component { From here, you can travel to any other city! A ticket costs{" "} .

-
               ,_   .  ._. _.  .
-
           , _-\','|~\~      ~/      ;-'_   _-'     ,;_;_,    ~~-
-
  /~~-\_/-'~'--' \~~| ',    ,'      /  / ~|-_\_/~/~      ~~--~~~~'--_
-
  /              ,/'-/~ '\ ,' _  , ','|~                   ._/-, /~
-
  ~/-'~\_,       '-,| '|. '   ~  ,\ /'~                /    /_  /~
-
.-~      '|        '',\~|\       _\~     ,_  ,              /,
-
          '\       /'~          |_/~\\,-,~  \ "         ,_,/ |
-
           |       /            ._-~'\_ _~|              \ ) 
-
            \   __-\           '/      ~ |\  \_          /  ~
-
  .,         '\ |,  ~-_      - |          \\_' ~|  /\  \~ ,
-
               ~-_'  _;       '\           '-,   \,' /\/  |
-
                 '\_,~'\_       \_ _,       /'    '  |, /|'
-
                   /     \_       ~ |      /         \  ~'; -,_.
-
                   |       ~\        |    |  ,        '-_, ,; ~ ~\
-
                    \,     /        \    / /|            ,-, ,   -,
-
                     |    ,/          |  |' |/          ,-   ~ \   '.
-
                    ,|   ,/           \ ,/              \      |
-
                    /    |             ~                 -~~-, /   _
-
                    | ,-'                                    ~    /
-
                    / ,'                                      ~
-
                    ',|  ~
-
                      ~'
+ createTravelPopup(city, this.props.travel)} /> ); } diff --git a/src/PersonObjects/Sleeve/ui/SleeveElem.tsx b/src/PersonObjects/Sleeve/ui/SleeveElem.tsx index e825139eb..e323b8962 100644 --- a/src/PersonObjects/Sleeve/ui/SleeveElem.tsx +++ b/src/PersonObjects/Sleeve/ui/SleeveElem.tsx @@ -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 { -