diff --git a/public/images/stations/air-filtering-unit-icon.png b/public/images/stations/air-filtering-unit-icon.png deleted file mode 100644 index 59055c251..000000000 Binary files a/public/images/stations/air-filtering-unit-icon.png and /dev/null differ diff --git a/public/images/stations/bitcoin-farm-icon.png b/public/images/stations/bitcoin-farm-icon.png deleted file mode 100644 index fda59a8c8..000000000 Binary files a/public/images/stations/bitcoin-farm-icon.png and /dev/null differ diff --git a/public/images/stations/booze-generator-icon.png b/public/images/stations/booze-generator-icon.png deleted file mode 100644 index d699a54b5..000000000 Binary files a/public/images/stations/booze-generator-icon.png and /dev/null differ diff --git a/public/images/stations/christmas-tree-icon.png b/public/images/stations/christmas-tree-icon.png deleted file mode 100644 index 464e17cc9..000000000 Binary files a/public/images/stations/christmas-tree-icon.png and /dev/null differ diff --git a/public/images/stations/defective-wall-icon.png b/public/images/stations/defective-wall-icon.png deleted file mode 100644 index 47579741b..000000000 Binary files a/public/images/stations/defective-wall-icon.png and /dev/null differ diff --git a/public/images/stations/generator-icon.png b/public/images/stations/generator-icon.png deleted file mode 100644 index 5ff2d3de9..000000000 Binary files a/public/images/stations/generator-icon.png and /dev/null differ diff --git a/public/images/stations/gym-icon.png b/public/images/stations/gym-icon.png deleted file mode 100644 index da4584d99..000000000 Binary files a/public/images/stations/gym-icon.png and /dev/null differ diff --git a/public/images/stations/hall-of-fame-icon.png b/public/images/stations/hall-of-fame-icon.png deleted file mode 100644 index 0e0fdc529..000000000 Binary files a/public/images/stations/hall-of-fame-icon.png and /dev/null differ diff --git a/public/images/stations/heating-icon.png b/public/images/stations/heating-icon.png deleted file mode 100644 index 9f6306858..000000000 Binary files a/public/images/stations/heating-icon.png and /dev/null differ diff --git a/public/images/stations/illumination-icon.png b/public/images/stations/illumination-icon.png deleted file mode 100644 index 47c571c62..000000000 Binary files a/public/images/stations/illumination-icon.png and /dev/null differ diff --git a/public/images/stations/intelligence-center-icon.png b/public/images/stations/intelligence-center-icon.png deleted file mode 100644 index cd6cd1318..000000000 Binary files a/public/images/stations/intelligence-center-icon.png and /dev/null differ diff --git a/public/images/stations/lavatory-icon.png b/public/images/stations/lavatory-icon.png deleted file mode 100644 index afa744af0..000000000 Binary files a/public/images/stations/lavatory-icon.png and /dev/null differ diff --git a/public/images/stations/library-icon.png b/public/images/stations/library-icon.png deleted file mode 100644 index 5ed633d2b..000000000 Binary files a/public/images/stations/library-icon.png and /dev/null differ diff --git a/public/images/stations/medstation-icon.png b/public/images/stations/medstation-icon.png deleted file mode 100644 index 2195b733e..000000000 Binary files a/public/images/stations/medstation-icon.png and /dev/null differ diff --git a/public/images/stations/nutrition-unit-icon.png b/public/images/stations/nutrition-unit-icon.png deleted file mode 100644 index 52b657706..000000000 Binary files a/public/images/stations/nutrition-unit-icon.png and /dev/null differ diff --git a/public/images/stations/rest-space-icon.png b/public/images/stations/rest-space-icon.png deleted file mode 100644 index 4bdcfe495..000000000 Binary files a/public/images/stations/rest-space-icon.png and /dev/null differ diff --git a/public/images/stations/scav-case-icon.png b/public/images/stations/scav-case-icon.png deleted file mode 100644 index b654416a7..000000000 Binary files a/public/images/stations/scav-case-icon.png and /dev/null differ diff --git a/public/images/stations/security-icon.png b/public/images/stations/security-icon.png deleted file mode 100644 index b3e97631e..000000000 Binary files a/public/images/stations/security-icon.png and /dev/null differ diff --git a/public/images/stations/shooting-range-icon.png b/public/images/stations/shooting-range-icon.png deleted file mode 100644 index b9fd64a68..000000000 Binary files a/public/images/stations/shooting-range-icon.png and /dev/null differ diff --git a/public/images/stations/solar-power-icon.png b/public/images/stations/solar-power-icon.png deleted file mode 100644 index f95270bfe..000000000 Binary files a/public/images/stations/solar-power-icon.png and /dev/null differ diff --git a/public/images/stations/stash-icon.png b/public/images/stations/stash-icon.png deleted file mode 100644 index ba1568265..000000000 Binary files a/public/images/stations/stash-icon.png and /dev/null differ diff --git a/public/images/stations/vents-icon.png b/public/images/stations/vents-icon.png deleted file mode 100644 index 860a7670b..000000000 Binary files a/public/images/stations/vents-icon.png and /dev/null differ diff --git a/public/images/stations/water-collector-icon.png b/public/images/stations/water-collector-icon.png deleted file mode 100644 index 7742dbe7a..000000000 Binary files a/public/images/stations/water-collector-icon.png and /dev/null differ diff --git a/public/images/stations/weapon-rack-icon.png b/public/images/stations/weapon-rack-icon.png deleted file mode 100644 index 09cd42c16..000000000 Binary files a/public/images/stations/weapon-rack-icon.png and /dev/null differ diff --git a/public/images/stations/workbench-icon.png b/public/images/stations/workbench-icon.png deleted file mode 100644 index f3e5231ce..000000000 Binary files a/public/images/stations/workbench-icon.png and /dev/null differ diff --git a/src/components/barter-tooltip/index.js b/src/components/barter-tooltip/index.js index 5738a6dd4..0fd3075f5 100644 --- a/src/components/barter-tooltip/index.js +++ b/src/components/barter-tooltip/index.js @@ -2,24 +2,27 @@ import { useTranslation } from 'react-i18next'; import { useMemo } from 'react'; import { useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; +import { Icon } from '@mdi/react'; +import { + mdiCached, + mdiProgressWrench +} from '@mdi/js'; import ItemImage from '../item-image/index.js'; import formatPrice from '../../modules/format-price.js'; import { isAnyDogtag, getDogTagCost } from '../../modules/dogtags.js'; import { getCheapestPrice } from '../../modules/format-cost-items.js'; import { getDurationDisplay } from '../../modules/format-duration.js'; - -import { Icon } from '@mdi/react'; -import { - mdiCached, - mdiProgressWrench -} from '@mdi/js'; +import useHideoutData from '../../features/hideout/index.js'; +import useTraderData from '../../features/traders/index.js'; import './index.css'; function BarterTooltip({ barter, showTitle = true, title, allowAllSources = false, crafts, barters, useBarterIngredients, useCraftIngredients }) { const settings = useSelector((state) => state.settings); const { t } = useTranslation(); + const { data: hideout } = useHideoutData(); + const { data: traders } = useTraderData(); if (barters && typeof useBarterIngredients === 'undefined') { useBarterIngredients = true; @@ -73,13 +76,16 @@ function BarterTooltip({ barter, showTitle = true, title, allowAllSources = fals let titleElement = ''; if (showTitle) { - const trader = barter.trader ? - `${barter.trader.name} ${t('LL{{level}}', { level: barter.level })}` : - `${barter.station.name} ${barter.level}`; + const source = barter.trader + ? traders.find(t => t.id === barter.trader.id) + : hideout.find(s => s.id === barter.station.id); + const sourceLevelText = barter.trader ? + `${source.name} ${t('LL{{level}}', { level: barter.level })}` : + `${source.name} ${barter.level}`; const tipTitle = barter.trader ? - t('Barter at {{trader}}', { trader: trader }) : - t('Craft at {{station}}', {station: trader}); + t('Barter at {{trader}}', { trader: sourceLevelText }) : + t('Craft at {{station}}', {station: sourceLevelText}); titleElement = (

@@ -121,7 +127,8 @@ function BarterTooltip({ barter, showTitle = true, title, allowAllSources = fals /> ); if (requiredItem.cheapestPrice.type === 'craft') { - const craftInfo = t('Craft at {{stationName}} {{stationLevel}}', {stationName: requiredItem.cheapestPrice.craft.station.name, stationLevel: requiredItem.cheapestPrice.craft.level}); + const station = hideout.find(s => s.id === requiredItem.cheapestPrice.craft.station.id); + const craftInfo = t('Craft at {{stationName}} {{stationLevel}}', {stationName: station.name, stationLevel: requiredItem.cheapestPrice.craft.level}); sourceImage = ( ); diff --git a/src/components/crafts-table/index.js b/src/components/crafts-table/index.js index 8b3e6fa74..541a69474 100644 --- a/src/components/crafts-table/index.js +++ b/src/components/crafts-table/index.js @@ -8,6 +8,7 @@ import DataTable from '../data-table/index.js'; import fleaMarketFee from '../../modules/flea-market-fee.mjs'; import useCraftsData from '../../features/crafts/index.js'; import useBartersData from '../../features/barters/index.js'; +import useHideoutData from '../../features/hideout/index.js'; import ValueCell from '../value-cell/index.js'; import CostItemsCell from '../cost-items-cell/index.js'; import formatCostItems from '../../modules/format-cost-items.js'; @@ -43,6 +44,7 @@ function CraftTable({ selectedStation, freeFuel, nameFilter, itemFilter, showAll const { data: meta } = useMetaData(); + const { data: hideout} = useHideoutData(); const data = useMemo(() => { let addedStations = {}; @@ -124,8 +126,8 @@ function CraftTable({ selectedStation, freeFuel, nameFilter, itemFilter, showAll } } - const station = craftRow.station.name; - const stationNormalized = craftRow.station.normalizedName; + const station = hideout.find(s => s.id === craftRow.station.id); + const stationNormalized = station.normalizedName; const level = craftRow.level; if (!nameFilter && selectedStation && selectedStation !== 'top' && selectedStation !== 'banned' && selectedStation !== stationNormalized) { @@ -203,7 +205,7 @@ function CraftTable({ selectedStation, freeFuel, nameFilter, itemFilter, showAll craftTime: craftDuration, reward: { item: craftRewardItem, - source: `${station} (${t('Level')} ${level})`, + source: `${station.name} (${t('Level')} ${level})`, count: craftRow.rewardItems[0].count, sellTo: bestSellTo.vendor.name, sellToNormalized: bestSellTo.vendor.normalizedName, @@ -343,6 +345,7 @@ function CraftTable({ selectedStation, freeFuel, nameFilter, itemFilter, showAll freeFuel, crafts, barters, + hideout, completedQuests, includeFlea, hasJaeger, diff --git a/src/components/item-image/index.js b/src/components/item-image/index.js index 796c9eaea..8ab0a0860 100644 --- a/src/components/item-image/index.js +++ b/src/components/item-image/index.js @@ -363,7 +363,7 @@ function ItemImage({ content={station.name} > - {station.name} + {station.name} } diff --git a/src/components/items-for-hideout/index.js b/src/components/items-for-hideout/index.js index 4349693e8..f01ccf154 100644 --- a/src/components/items-for-hideout/index.js +++ b/src/components/items-for-hideout/index.js @@ -97,7 +97,7 @@ function ItemsForHideout(props) { alt={item.moduleName} className="quest-giver-image" loading="lazy" - src={`${process.env.PUBLIC_URL}/images/stations/${item.normalizedName}-icon.png`} + src={item.imageLink} />
{item.moduleName} diff --git a/src/components/items-summary-table/index.js b/src/components/items-summary-table/index.js index 6ab8d3309..5e9e3339f 100644 --- a/src/components/items-summary-table/index.js +++ b/src/components/items-summary-table/index.js @@ -100,7 +100,7 @@ function ItemsSummaryTable({includeItems, includeTraders, includeStations}) { ...station, quantity: req.level, //itemLink: `#`, - iconLink: `images/stations/${station.normalizedName}-icon.png`, + iconLink: station.imageLink, types: [], barters: [], buyOnFleaPrice: 0, @@ -274,7 +274,8 @@ function ItemsSummaryTable({includeItems, includeTraders, includeStations}) { ); } else if (cheapestObtainInfo.craft) { const craft = cheapestObtainInfo.craft; - priceSource = `${craft.station.name} ${craft.level}`; + const station = stations.find(s => s.id === craft.station.id); + priceSource = `${station.name} ${craft.level}`; let barterTipTitle = ''; if (craft.taskUnlock) { taskIcon = ( @@ -406,7 +407,7 @@ function ItemsSummaryTable({includeItems, includeTraders, includeStations}) { ]; return useColumns; - }, [t, items, barters, crafts, settings]); + }, [t, items, barters, crafts, stations, settings]); const extraRow = ( <> diff --git a/src/components/small-item-table/index.js b/src/components/small-item-table/index.js index 720a3cef7..1de4b41f8 100644 --- a/src/components/small-item-table/index.js +++ b/src/components/small-item-table/index.js @@ -32,6 +32,7 @@ import itemCanContain from '../../modules/item-can-contain.js'; import useBartersData from '../../features/barters/index.js'; import useCraftsData from '../../features/crafts/index.js'; import useItemsData from '../../features/items/index.js'; +import useHideoutData from '../../features/hideout/index.js'; import useMetaData from '../../features/meta/index.js'; import CanvasGrid from '../../components/canvas-grid/index.js'; @@ -318,6 +319,8 @@ function SmallItemTable(props) { const { data: crafts } = useCraftsData(); + const { data: hideout } = useHideoutData(); + const containedItems = useMemo(() => { if (!containedInFilter) return {}; @@ -1671,7 +1674,8 @@ function SmallItemTable(props) { ); } else if (cheapestObtainInfo.craft) { const craft = cheapestObtainInfo.craft; - priceSource = `${craft.station.name} ${craft.level}`; + const station = hideout.find(s => s.id === craft.station.id); + priceSource = `${station.name} ${craft.level}`; let barterTipTitle = ''; if (craft.taskUnlock) { taskIcon = ( @@ -1867,6 +1871,7 @@ function SmallItemTable(props) { items, barters, crafts, + hideout, useBarterIngredients, useCraftIngredients, distance, diff --git a/src/components/station-skill-trader-setting/index.js b/src/components/station-skill-trader-setting/index.js index 4af128141..4dc501f7c 100644 --- a/src/components/station-skill-trader-setting/index.js +++ b/src/components/station-skill-trader-setting/index.js @@ -86,12 +86,12 @@ const getOptionsForTrader = (t, traderKey) => { }; const StationSkillTraderSetting = React.forwardRef((props, ref) => { - const { stateKey, type, isDisabled, label } = props; + const { stateKey, type, isDisabled, label, image } = props; const { t } = useTranslation(); let selector; let options; - let iconExt = 'png'; + let imageLink = image; const toolTip = label || t(capitalizeFirst(camelcaseToDashes(stateKey).replace(/-/g, ' '))); if (type === 'station') { selector = selectAllStations; @@ -101,10 +101,11 @@ const StationSkillTraderSetting = React.forwardRef((props, ref) => { // t('Hideout Management') selector = selectAllSkills; options = getOptionsForSkill(t, stateKey); + imageLink = `${process.env.PUBLIC_URL}/images/${type}s/${stateKey}-icon.png`; } else if (type === 'trader') { selector = selectAllTraders; options = getOptionsForTrader(t, stateKey); - iconExt = 'jpg'; + imageLink = `${process.env.PUBLIC_URL}/images/${type}s/${stateKey}-icon.jpg`; } const dispatch = useDispatch(); const state = useSelector(selector); @@ -123,7 +124,7 @@ const StationSkillTraderSetting = React.forwardRef((props, ref) => { alt={`${stateKey}-icon`} loading="lazy" height={39} - src={`${process.env.PUBLIC_URL}/images/${type}s/${stateKey}-icon.${iconExt}`} + src={imageLink} width={39} />