diff --git a/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx b/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx index fc78a42529..7fb2585519 100644 --- a/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx +++ b/tgui/packages/tgui/interfaces/VorePanelExport/VorePanelExportDownload.tsx @@ -73,6 +73,7 @@ export const downloadPrefs = (extension: string) => { const exportPayload = { [mob_name]: { version: db_version, + repo: db_repo, bellies: validBellies, soulcatcher: soulcatcher, }, diff --git a/tgui/packages/tgui/interfaces/VorePanelImport/ImportElements/CharacterSelector.tsx b/tgui/packages/tgui/interfaces/VorePanelImport/ImportElements/CharacterSelector.tsx index 8b7a9eaf0e..70a149a543 100644 --- a/tgui/packages/tgui/interfaces/VorePanelImport/ImportElements/CharacterSelector.tsx +++ b/tgui/packages/tgui/interfaces/VorePanelImport/ImportElements/CharacterSelector.tsx @@ -11,7 +11,7 @@ import { } from 'tgui-core/components'; import { createSearch } from 'tgui-core/string'; import { getCurrentTimestamp } from '../../VorePanelExport/VorePanelExportTimestamp'; -import { CURRENT_VERSION } from '../constants'; +import { CURRENT_VERSION, UNKNOWN_ORIGIN } from '../constants'; import { importLengthToColor } from '../function'; import type { DesiredData } from '../types'; @@ -22,6 +22,7 @@ export const CharacterSelector = (props: { onSelectedCharacters: React.Dispatch>>; importLength: number; selectedVersions: string[]; + selectedOrigins: string[]; }) => { const { characterData, @@ -30,6 +31,7 @@ export const CharacterSelector = (props: { onSelectedCharacters, importLength, selectedVersions, + selectedOrigins, } = props; const [searchText, setSearchText] = useState(''); @@ -104,7 +106,11 @@ export const CharacterSelector = (props: { scrollable title="Characters" buttons={ - } @@ -184,6 +190,19 @@ export const CharacterSelector = (props: { ))} + + {selectedOrigins.map((origin, index) => ( + + + {origin} + + {index < selectedVersions.length - 1 && ', '} + + ))} + diff --git a/tgui/packages/tgui/interfaces/VorePanelImport/constants.ts b/tgui/packages/tgui/interfaces/VorePanelImport/constants.ts index 097a9385ad..56753121cc 100644 --- a/tgui/packages/tgui/interfaces/VorePanelImport/constants.ts +++ b/tgui/packages/tgui/interfaces/VorePanelImport/constants.ts @@ -1 +1,3 @@ export const CURRENT_VERSION = 0.3; + +export const UNKNOWN_ORIGIN = 'unknown'; diff --git a/tgui/packages/tgui/interfaces/VorePanelImport/function.ts b/tgui/packages/tgui/interfaces/VorePanelImport/function.ts index 8b76c63750..79d81186c9 100644 --- a/tgui/packages/tgui/interfaces/VorePanelImport/function.ts +++ b/tgui/packages/tgui/interfaces/VorePanelImport/function.ts @@ -1,3 +1,4 @@ +import { UNKNOWN_ORIGIN } from './constants'; import type { DesiredData, ImportData } from './types'; export function importLengthToColor(importLength: number): string { @@ -21,6 +22,7 @@ export function handleImportData(importString: string | string[]): DesiredData { bellies: Array.isArray(parsedData) ? parsedData : [], soulcatcher: undefined, version: '0.1', + repo: UNKNOWN_ORIGIN, }, }; return ourBellies; @@ -34,6 +36,7 @@ export function handleImportData(importString: string | string[]): DesiredData { ? parsedData.soulcatcher : {}, version: '0.2', + repo: UNKNOWN_ORIGIN, }, }; return ourBellies; @@ -50,6 +53,7 @@ export function handleImportData(importString: string | string[]): DesiredData { ? ourData.soulcatcher : {}, version: ourData.version, + repo: ourData.repo, }, ]; } else { @@ -59,6 +63,7 @@ export function handleImportData(importString: string | string[]): DesiredData { bellies: {}, soulcatcher: {}, version: '0.3', + repo: UNKNOWN_ORIGIN, }, ]; } diff --git a/tgui/packages/tgui/interfaces/VorePanelImport/index.tsx b/tgui/packages/tgui/interfaces/VorePanelImport/index.tsx index 0d53286d5d..b6b0666176 100644 --- a/tgui/packages/tgui/interfaces/VorePanelImport/index.tsx +++ b/tgui/packages/tgui/interfaces/VorePanelImport/index.tsx @@ -18,6 +18,7 @@ export const VorePanelImport = () => { const [activeTab, setActiveTab] = useState(''); const [currentLength, setCurrentLength] = useState(0); const [selectedVersions, setSelectedVersions] = useState([]); + const [selectedOrigins, setSelectedOrigins] = useState([]); const filteredData = Object.fromEntries( Array.from(selectedCharacters).map((name) => [name, characterData[name]]), @@ -52,7 +53,15 @@ export const VorePanelImport = () => { ), ); + const allOrigins = Array.from( + new Set( + Object.values(filteredData) + .map((dataEntry) => dataEntry.repo) + .filter((v): v is string => typeof v === 'string'), + ), + ); setSelectedVersions(allVersions); + setSelectedOrigins(allOrigins); }, [filteredData]); function handleTabChange(newTab: string) { @@ -82,6 +91,7 @@ export const VorePanelImport = () => { onSelectedCharacters={setSelectedCharacters} importLength={currentLength} selectedVersions={selectedVersions} + selectedOrigins={selectedOrigins} /> diff --git a/tgui/packages/tgui/interfaces/VorePanelImport/types.ts b/tgui/packages/tgui/interfaces/VorePanelImport/types.ts index 24879ade93..370f48637d 100644 --- a/tgui/packages/tgui/interfaces/VorePanelImport/types.ts +++ b/tgui/packages/tgui/interfaces/VorePanelImport/types.ts @@ -6,5 +6,6 @@ export type DesiredData = Record< bellies: Record[]; soulcatcher?: Record; version?: string; + repo?: string; } >;