mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 10:45:54 +00:00
feat(Core): Allowed system temp names up to 12 characters. Deprecated showing linked signature ID as part of temporary name.
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
import { useMemo } from 'react';
|
import { getSystemClassStyles } from '@/hooks/Mapper/components/map/helpers';
|
||||||
import { MapSolarSystemType } from '../map.types';
|
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace';
|
||||||
import { NodeProps } from 'reactflow';
|
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider';
|
||||||
|
import { REGIONS_MAP, Spaces } from '@/hooks/Mapper/constants';
|
||||||
|
import { sortWHClasses } from '@/hooks/Mapper/helpers';
|
||||||
|
import { useDoubleClick } from '@/hooks/Mapper/hooks/useDoubleClick';
|
||||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||||
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||||
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider';
|
|
||||||
import { useDoubleClick } from '@/hooks/Mapper/hooks/useDoubleClick';
|
|
||||||
import { REGIONS_MAP, Spaces } from '@/hooks/Mapper/constants';
|
|
||||||
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace';
|
|
||||||
import { getSystemClassStyles } from '@/hooks/Mapper/components/map/helpers';
|
|
||||||
import { sortWHClasses } from '@/hooks/Mapper/helpers';
|
|
||||||
import { CharacterTypeRaw, OutCommand, PingType, SystemSignature } from '@/hooks/Mapper/types';
|
|
||||||
import { useUnsplashedSignatures } from './useUnsplashedSignatures';
|
|
||||||
import { useSystemName } from './useSystemName';
|
|
||||||
import { LabelInfo, useLabelsInfo } from './useLabelsInfo';
|
|
||||||
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
|
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
|
||||||
|
import { CharacterTypeRaw, OutCommand, PingType, SystemSignature } from '@/hooks/Mapper/types';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
import { NodeProps } from 'reactflow';
|
||||||
|
import { MapSolarSystemType } from '../map.types';
|
||||||
|
import { LabelInfo, useLabelsInfo } from './useLabelsInfo';
|
||||||
|
import { useSystemName } from './useSystemName';
|
||||||
|
import { useUnsplashedSignatures } from './useUnsplashedSignatures';
|
||||||
|
|
||||||
function getActivityType(count: number): string {
|
function getActivityType(count: number): string {
|
||||||
if (count <= 5) return 'activityNormal';
|
if (count <= 5) return 'activityNormal';
|
||||||
@@ -117,7 +117,6 @@ export const useSolarSystemNode = (props: NodeProps<MapSolarSystemType>): SolarS
|
|||||||
const { isShowUnsplashedSignatures } = interfaceSettings;
|
const { isShowUnsplashedSignatures } = interfaceSettings;
|
||||||
const isTempSystemNameEnabled = useMapGetOption('show_temp_system_name') === 'true';
|
const isTempSystemNameEnabled = useMapGetOption('show_temp_system_name') === 'true';
|
||||||
const isShowLinkedSigId = useMapGetOption('show_linked_signature_id') === 'true';
|
const isShowLinkedSigId = useMapGetOption('show_linked_signature_id') === 'true';
|
||||||
const isShowLinkedSigIdTempName = useMapGetOption('show_linked_signature_id_temp_name') === 'true';
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: {
|
data: {
|
||||||
@@ -184,8 +183,6 @@ export const useSolarSystemNode = (props: NodeProps<MapSolarSystemType>): SolarS
|
|||||||
const { systemName, computedTemporaryName, customName } = useSystemName({
|
const { systemName, computedTemporaryName, customName } = useSystemName({
|
||||||
isTempSystemNameEnabled,
|
isTempSystemNameEnabled,
|
||||||
temporary_name,
|
temporary_name,
|
||||||
isShowLinkedSigIdTempName,
|
|
||||||
linkedSigPrefix,
|
|
||||||
name,
|
name,
|
||||||
systemStaticInfo,
|
systemStaticInfo,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import { useMemo } from 'react';
|
|
||||||
import { SolarSystemStaticInfoRaw } from '@/hooks/Mapper/types';
|
import { SolarSystemStaticInfoRaw } from '@/hooks/Mapper/types';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
interface UseSystemNameParams {
|
interface UseSystemNameParams {
|
||||||
isTempSystemNameEnabled: boolean;
|
isTempSystemNameEnabled: boolean;
|
||||||
temporary_name?: string | null;
|
temporary_name?: string | null;
|
||||||
isShowLinkedSigIdTempName: boolean;
|
|
||||||
linkedSigPrefix: string | null;
|
|
||||||
name?: string | null;
|
name?: string | null;
|
||||||
systemStaticInfo: SolarSystemStaticInfoRaw;
|
systemStaticInfo: SolarSystemStaticInfoRaw;
|
||||||
}
|
}
|
||||||
@@ -13,8 +11,6 @@ interface UseSystemNameParams {
|
|||||||
export const useSystemName = ({
|
export const useSystemName = ({
|
||||||
isTempSystemNameEnabled,
|
isTempSystemNameEnabled,
|
||||||
temporary_name,
|
temporary_name,
|
||||||
isShowLinkedSigIdTempName,
|
|
||||||
linkedSigPrefix,
|
|
||||||
name,
|
name,
|
||||||
systemStaticInfo,
|
systemStaticInfo,
|
||||||
}: UseSystemNameParams) => {
|
}: UseSystemNameParams) => {
|
||||||
@@ -25,12 +21,8 @@ export const useSystemName = ({
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isShowLinkedSigIdTempName && linkedSigPrefix) {
|
|
||||||
return temporary_name ? `${linkedSigPrefix}・${temporary_name}` : `${linkedSigPrefix}・${solar_system_name}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return temporary_name ?? '';
|
return temporary_name ?? '';
|
||||||
}, [isTempSystemNameEnabled, temporary_name, solar_system_name, isShowLinkedSigIdTempName, linkedSigPrefix]);
|
}, [isTempSystemNameEnabled, temporary_name]);
|
||||||
|
|
||||||
const systemName = useMemo(() => {
|
const systemName = useMemo(() => {
|
||||||
if (isTempSystemNameEnabled && computedTemporaryName) {
|
if (isTempSystemNameEnabled && computedTemporaryName) {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { InputText } from 'primereact/inputtext';
|
import { TooltipPosition, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit';
|
||||||
import { InputTextarea } from 'primereact/inputtextarea';
|
|
||||||
import { Dialog } from 'primereact/dialog';
|
|
||||||
import { getSystemById } from '@/hooks/Mapper/helpers';
|
import { getSystemById } from '@/hooks/Mapper/helpers';
|
||||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||||
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
import { useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
||||||
import { Button } from 'primereact/button';
|
|
||||||
import { OutCommand } from '@/hooks/Mapper/types';
|
|
||||||
import { IconField } from 'primereact/iconfield';
|
|
||||||
import { TooltipPosition, WdImageSize, WdImgButton } from '@/hooks/Mapper/components/ui-kit';
|
|
||||||
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
|
|
||||||
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
|
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic';
|
||||||
|
import { OutCommand } from '@/hooks/Mapper/types';
|
||||||
|
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
|
||||||
|
import { Button } from 'primereact/button';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { IconField } from 'primereact/iconfield';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { InputTextarea } from 'primereact/inputtextarea';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
interface SystemSettingsDialog {
|
interface SystemSettingsDialog {
|
||||||
systemId: string;
|
systemId: string;
|
||||||
@@ -206,7 +206,7 @@ export const SystemSettingsDialog = ({ systemId, visible, setVisible }: SystemSe
|
|||||||
aria-describedby="temporaryName"
|
aria-describedby="temporaryName"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
value={temporaryName}
|
value={temporaryName}
|
||||||
maxLength={10}
|
maxLength={12}
|
||||||
onChange={e => setTemporaryName(e.target.value)}
|
onChange={e => setTemporaryName(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</IconField>
|
</IconField>
|
||||||
|
|||||||
@@ -413,11 +413,6 @@
|
|||||||
field={f[:show_linked_signature_id]}
|
field={f[:show_linked_signature_id]}
|
||||||
label="Show linked signature ID as custom label part"
|
label="Show linked signature ID as custom label part"
|
||||||
/>
|
/>
|
||||||
<.input
|
|
||||||
type="checkbox"
|
|
||||||
field={f[:show_linked_signature_id_temp_name]}
|
|
||||||
label="Show linked signature ID as temporary name part"
|
|
||||||
/>
|
|
||||||
<.input
|
<.input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
field={f[:restrict_offline_showing]}
|
field={f[:restrict_offline_showing]}
|
||||||
|
|||||||
Reference in New Issue
Block a user