mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-11-19 15:46:12 +00:00
Compare commits
13 Commits
ui-issues-
...
all-system
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9196b42fc5 | ||
|
|
3f6364c9ea | ||
|
|
0d11b12282 | ||
|
|
a5020b58f2 | ||
|
|
f039a74a8f | ||
|
|
0e6bb7390b | ||
|
|
b52b4eecca | ||
|
|
8186977d1d | ||
|
|
86adcfe4d7 | ||
|
|
ce2dd872c4 | ||
|
|
aadc53c90e | ||
|
|
cbc1b6b5c8 | ||
|
|
1aed7a9232 |
52
CHANGELOG.md
52
CHANGELOG.md
@@ -2,6 +2,58 @@
|
|||||||
|
|
||||||
<!-- changelog -->
|
<!-- changelog -->
|
||||||
|
|
||||||
|
## [v1.31.0](https://github.com/wanderer-industries/wanderer/compare/v1.30.2...v1.31.0) (2024-12-20)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Features:
|
||||||
|
|
||||||
|
* Core: Show tracking for new users by default. Auto link characters to account fix. Add character loading indicators.
|
||||||
|
|
||||||
|
## [v1.30.2](https://github.com/wanderer-industries/wanderer/compare/v1.30.1...v1.30.2) (2024-12-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes:
|
||||||
|
|
||||||
|
* Map: Fixed problem with ship size change.
|
||||||
|
|
||||||
|
## [v1.30.1](https://github.com/wanderer-industries/wanderer/compare/v1.30.0...v1.30.1) (2024-12-17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes:
|
||||||
|
|
||||||
|
* Map: Little rework Signatures header: change System Signatures to Signatures, and show selected system name instead.
|
||||||
|
|
||||||
|
* Map: update default size of connections
|
||||||
|
|
||||||
|
* Map: add ability set the size of wormhole and mark connection with label
|
||||||
|
|
||||||
|
## [v1.30.0](https://github.com/wanderer-industries/wanderer/compare/v1.29.5...v1.30.0) (2024-12-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Features:
|
||||||
|
|
||||||
|
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues. #2
|
||||||
|
|
||||||
|
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues.
|
||||||
|
|
||||||
|
### Bug Fixes:
|
||||||
|
|
||||||
|
* Map: fixed U210, K346 for C4 shattered systems
|
||||||
|
|
||||||
|
* Map: fixed U210, K346 for shattered systems. Fixed mass of mediums chains. Fixed size of some capital chains from 3M to 3.3M. Based on https://whtype.info/ data.
|
||||||
|
|
||||||
|
* Map: removed unnecessary log
|
||||||
|
|
||||||
|
* Map: Uncomment what should not be commented
|
||||||
|
|
||||||
## [v1.29.5](https://github.com/wanderer-industries/wanderer/compare/v1.29.4...v1.29.5) (2024-12-14)
|
## [v1.29.5](https://github.com/wanderer-industries/wanderer/compare/v1.29.4...v1.29.5) (2024-12-14)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ export const useSystemInfo = ({ systemId }: UseSystemInfoProps) => {
|
|||||||
|
|
||||||
const { systems: systemStatics } = useLoadSystemStatic({ systems: [systemId] });
|
const { systems: systemStatics } = useLoadSystemStatic({ systems: [systemId] });
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('JOipP', `systemStatics`, systemStatics);
|
|
||||||
|
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
const staticInfo = systemStatics.get(parseInt(systemId));
|
const staticInfo = systemStatics.get(parseInt(systemId));
|
||||||
const dynamicInfo = getSystemById(systems, systemId);
|
const dynamicInfo = getSystemById(systems, systemId);
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ import { Edge } from '@reactflow/core/dist/esm/types/edges';
|
|||||||
import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeStatus } from '@/hooks/Mapper/types';
|
import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeStatus } from '@/hooks/Mapper/types';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import classes from './ContextMenuConnection.module.scss';
|
import classes from './ContextMenuConnection.module.scss';
|
||||||
import { MASS_STATE_NAMES, MASS_STATE_NAMES_ORDER } from '@/hooks/Mapper/components/map/constants.ts';
|
import {
|
||||||
|
MASS_STATE_NAMES,
|
||||||
|
MASS_STATE_NAMES_ORDER,
|
||||||
|
SHIP_SIZES_NAMES,
|
||||||
|
SHIP_SIZES_NAMES_ORDER,
|
||||||
|
SHIP_SIZES_NAMES_SHORT,
|
||||||
|
SHIP_SIZES_SIZE,
|
||||||
|
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||||
|
|
||||||
export interface ContextMenuConnectionProps {
|
export interface ContextMenuConnectionProps {
|
||||||
contextMenuRef: RefObject<ContextMenu>;
|
contextMenuRef: RefObject<ContextMenu>;
|
||||||
@@ -48,10 +55,6 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
|||||||
icon: PrimeIcons.CLOCK,
|
icon: PrimeIcons.CLOCK,
|
||||||
command: onChangeTimeState,
|
command: onChangeTimeState,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
...(isWormhole
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
label: `Frigate`,
|
label: `Frigate`,
|
||||||
className: clsx({
|
className: clsx({
|
||||||
@@ -60,13 +63,9 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
|||||||
icon: PrimeIcons.CLOUD,
|
icon: PrimeIcons.CLOUD,
|
||||||
command: () =>
|
command: () =>
|
||||||
onChangeShipSizeStatus(
|
onChangeShipSizeStatus(
|
||||||
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.normal : ShipSizeStatus.small,
|
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.large : ShipSizeStatus.small,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
...(isWormhole
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
label: `Save mass`,
|
label: `Save mass`,
|
||||||
className: clsx({
|
className: clsx({
|
||||||
@@ -75,9 +74,7 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
|||||||
icon: PrimeIcons.LOCK,
|
icon: PrimeIcons.LOCK,
|
||||||
command: () => onToggleMassSave(!edge.data?.locked),
|
command: () => onToggleMassSave(!edge.data?.locked),
|
||||||
},
|
},
|
||||||
]
|
...(!isFrigateSize
|
||||||
: []),
|
|
||||||
...(isWormhole && !isFrigateSize
|
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: `Mass status`,
|
label: `Mass status`,
|
||||||
@@ -92,13 +89,36 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
|
||||||
|
{
|
||||||
|
label: `Ship Size`,
|
||||||
|
icon: PrimeIcons.CLOUD,
|
||||||
|
items: SHIP_SIZES_NAMES_ORDER.map(x => ({
|
||||||
|
label: (
|
||||||
|
<div className="grid grid-cols-[20px_120px_1fr_40px] gap-2 items-center">
|
||||||
|
<div className="text-[12px] font-bold text-stone-400">{SHIP_SIZES_NAMES_SHORT[x]}</div>
|
||||||
|
<div>{SHIP_SIZES_NAMES[x]}</div>
|
||||||
|
<div></div>
|
||||||
|
<div className="flex justify-end whitespace-nowrap text-[12px] font-bold text-stone-500">
|
||||||
|
{SHIP_SIZES_SIZE[x]} t.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) as unknown as string, // TODO my lovely kostyl
|
||||||
|
className: clsx({
|
||||||
|
[classes.SelectedItem]: edge.data?.ship_size_type === x,
|
||||||
|
}),
|
||||||
|
command: () => onChangeShipSizeStatus(x),
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
label: 'Disconnect',
|
label: 'Disconnect',
|
||||||
icon: PrimeIcons.TRASH,
|
icon: PrimeIcons.TRASH,
|
||||||
command: onDeleteConnection,
|
command: onDeleteConnection,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [edge, onChangeTimeState, onDeleteConnection, onChangeMassState, onChangeShipSizeStatus]);
|
}, [edge, onChangeTimeState, onDeleteConnection, onChangeShipSizeStatus, onToggleMassSave, onChangeMassState]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ export const useContextMenuConnectionHandlers = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (status === ShipSizeStatus.small) {
|
||||||
outCommand({
|
outCommand({
|
||||||
type: OutCommand.updateConnectionMassStatus,
|
type: OutCommand.updateConnectionMassStatus,
|
||||||
data: {
|
data: {
|
||||||
@@ -105,6 +106,7 @@ export const useContextMenuConnectionHandlers = () => {
|
|||||||
value: MassState.normal,
|
value: MassState.normal,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onToggleMassSave = useCallback((locked: boolean) => {
|
const onToggleMassSave = useCallback((locked: boolean) => {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeS
|
|||||||
import { PrimeIcons } from 'primereact/api';
|
import { PrimeIcons } from 'primereact/api';
|
||||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||||
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider.tsx';
|
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider.tsx';
|
||||||
|
import { SHIP_SIZES_DESCRIPTION, SHIP_SIZES_NAMES_SHORT } from '@/hooks/Mapper/components/map/constants.ts';
|
||||||
|
|
||||||
const MAP_TRANSLATES: Record<string, string> = {
|
const MAP_TRANSLATES: Record<string, string> = {
|
||||||
[Position.Top]: 'translate(-48%, 0%)',
|
[Position.Top]: 'translate(-48%, 0%)',
|
||||||
@@ -30,6 +31,14 @@ const MAP_OFFSETS: Record<string, { x: number; y: number }> = {
|
|||||||
[Position.Right]: { x: 0, y: 0 },
|
[Position.Right]: { x: 0, y: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const SHIP_SIZES_COLORS = {
|
||||||
|
[ShipSizeStatus.small]: 'bg-indigo-400',
|
||||||
|
[ShipSizeStatus.medium]: 'bg-cyan-500',
|
||||||
|
[ShipSizeStatus.large]: '',
|
||||||
|
[ShipSizeStatus.freight]: 'bg-lime-400',
|
||||||
|
[ShipSizeStatus.capital]: 'bg-red-400',
|
||||||
|
};
|
||||||
|
|
||||||
export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }: EdgeProps<SolarSystemConnection>) => {
|
export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }: EdgeProps<SolarSystemConnection>) => {
|
||||||
const sourceNode = useStore(useCallback(store => store.nodeInternals.get(source), [source]));
|
const sourceNode = useStore(useCallback(store => store.nodeInternals.get(source), [source]));
|
||||||
const targetNode = useStore(useCallback(store => store.nodeInternals.get(target), [target]));
|
const targetNode = useStore(useCallback(store => store.nodeInternals.get(target), [target]));
|
||||||
@@ -137,6 +146,19 @@ export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }:
|
|||||||
<span className={clsx(PrimeIcons.LOCK, classes.icon)} />
|
<span className={clsx(PrimeIcons.LOCK, classes.icon)} />
|
||||||
</WdTooltipWrapper>
|
</WdTooltipWrapper>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{isWormhole && data.ship_size_type !== ShipSizeStatus.large && (
|
||||||
|
<WdTooltipWrapper
|
||||||
|
content={SHIP_SIZES_DESCRIPTION[data.ship_size_type]}
|
||||||
|
className={clsx(
|
||||||
|
classes.LinkLabel,
|
||||||
|
'pointer-events-auto rounded opacity-100 cursor-auto text-neutral-900 font-bold',
|
||||||
|
SHIP_SIZES_COLORS[data.ship_size_type],
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{SHIP_SIZES_NAMES_SHORT[data.ship_size_type]}
|
||||||
|
</WdTooltipWrapper>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</EdgeLabelRenderer>
|
</EdgeLabelRenderer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ConnectionType, MassState } from '@/hooks/Mapper/types';
|
import { ConnectionType, MassState, ShipSizeStatus } from '@/hooks/Mapper/types';
|
||||||
|
|
||||||
export enum SOLAR_SYSTEM_CLASS_IDS {
|
export enum SOLAR_SYSTEM_CLASS_IDS {
|
||||||
ccp1 = -1,
|
ccp1 = -1,
|
||||||
@@ -727,16 +727,41 @@ export const MASS_STATE_NAMES = {
|
|||||||
[MassState.verge]: 'Verge of collapse',
|
[MassState.verge]: 'Verge of collapse',
|
||||||
};
|
};
|
||||||
|
|
||||||
// export const SHIP_SIZES_NAMES_ORDER = [
|
export const SHIP_SIZES_NAMES_ORDER = [
|
||||||
// ShipSizeStatus.small,
|
ShipSizeStatus.small,
|
||||||
// ShipSizeStatus.normal,
|
ShipSizeStatus.medium,
|
||||||
// // ShipSizeStatus.large,
|
ShipSizeStatus.large,
|
||||||
// // ShipSizeStatus.capital,
|
ShipSizeStatus.freight,
|
||||||
// ];
|
ShipSizeStatus.capital,
|
||||||
//
|
];
|
||||||
// export const SHIP_SIZES_NAMES = {
|
|
||||||
// [ShipSizeStatus.small]: 'Frigate',
|
export const SHIP_SIZES_NAMES = {
|
||||||
// [ShipSizeStatus.normal]: 'Normal',
|
[ShipSizeStatus.small]: 'Frigate',
|
||||||
// // [ShipSizeStatus.large]: 'Normal',
|
[ShipSizeStatus.medium]: 'Medium',
|
||||||
// // [ShipSizeStatus.capital]: 'Normal',
|
[ShipSizeStatus.large]: 'Normal',
|
||||||
// };
|
[ShipSizeStatus.freight]: 'Huge',
|
||||||
|
[ShipSizeStatus.capital]: 'Capital',
|
||||||
|
};
|
||||||
|
export const SHIP_SIZES_SIZE = {
|
||||||
|
[ShipSizeStatus.small]: '5K',
|
||||||
|
[ShipSizeStatus.medium]: '62K',
|
||||||
|
[ShipSizeStatus.large]: '375K',
|
||||||
|
[ShipSizeStatus.freight]: '1M',
|
||||||
|
[ShipSizeStatus.capital]: '2M',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SHIP_SIZES_DESCRIPTION = {
|
||||||
|
[ShipSizeStatus.small]: 'Frigate wormhole - up to Destroyer | 5K t.',
|
||||||
|
[ShipSizeStatus.medium]: 'Cruise wormhole - up to Battlecruiser | 62K t.',
|
||||||
|
[ShipSizeStatus.large]: 'Large wormhole - up to Battleship | 375K t.',
|
||||||
|
[ShipSizeStatus.freight]: 'Huge wormhole - up to Freighter | 1M t.',
|
||||||
|
[ShipSizeStatus.capital]: 'Capital wormhole - up to Capital | 2M t.',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SHIP_SIZES_NAMES_SHORT = {
|
||||||
|
[ShipSizeStatus.small]: 'S',
|
||||||
|
[ShipSizeStatus.medium]: 'M',
|
||||||
|
[ShipSizeStatus.large]: 'L',
|
||||||
|
[ShipSizeStatus.freight]: 'H',
|
||||||
|
[ShipSizeStatus.capital]: 'XL',
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,25 +2,26 @@ import { Widget } from '@/hooks/Mapper/components/mapInterface/components';
|
|||||||
import {
|
import {
|
||||||
InfoDrawer,
|
InfoDrawer,
|
||||||
LayoutEventBlocker,
|
LayoutEventBlocker,
|
||||||
|
SystemView,
|
||||||
TooltipPosition,
|
TooltipPosition,
|
||||||
WdImgButton,
|
|
||||||
WdCheckbox,
|
WdCheckbox,
|
||||||
|
WdImgButton,
|
||||||
} from '@/hooks/Mapper/components/ui-kit';
|
} from '@/hooks/Mapper/components/ui-kit';
|
||||||
import { SystemSignaturesContent } from './SystemSignaturesContent';
|
import { SystemSignaturesContent } from './SystemSignaturesContent';
|
||||||
import {
|
import {
|
||||||
Setting,
|
|
||||||
SystemSignatureSettingsDialog,
|
|
||||||
COSMIC_SIGNATURE,
|
|
||||||
COSMIC_ANOMALY,
|
COSMIC_ANOMALY,
|
||||||
|
COSMIC_SIGNATURE,
|
||||||
DEPLOYABLE,
|
DEPLOYABLE,
|
||||||
STRUCTURE,
|
|
||||||
STARBASE,
|
|
||||||
SHIP,
|
|
||||||
DRONE,
|
DRONE,
|
||||||
|
Setting,
|
||||||
|
SHIP,
|
||||||
|
STARBASE,
|
||||||
|
STRUCTURE,
|
||||||
|
SystemSignatureSettingsDialog,
|
||||||
} from './SystemSignatureSettingsDialog';
|
} from './SystemSignatureSettingsDialog';
|
||||||
import { SignatureGroup } from '@/hooks/Mapper/types';
|
import { SignatureGroup } from '@/hooks/Mapper/types';
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useState, useMemo, useRef } from 'react';
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { PrimeIcons } from 'primereact/api';
|
import { PrimeIcons } from 'primereact/api';
|
||||||
|
|
||||||
@@ -105,7 +106,14 @@ export const SystemSignatures = () => {
|
|||||||
<Widget
|
<Widget
|
||||||
label={
|
label={
|
||||||
<div className="flex justify-between items-center text-xs w-full h-full" ref={ref}>
|
<div className="flex justify-between items-center text-xs w-full h-full" ref={ref}>
|
||||||
<div className="flex gap-1 whitespace-nowrap text-ellipsis overflow-hidden">System Signatures</div>
|
<div className="flex justify-between items-center gap-1">
|
||||||
|
{!compact && (
|
||||||
|
<div className="flex whitespace-nowrap text-ellipsis overflow-hidden text-stone-400">
|
||||||
|
Signatures {isNotSelectedSystem ? '' : 'in'}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{!isNotSelectedSystem && <SystemView systemId={systemId} className="select-none text-center" hideRegion />}
|
||||||
|
</div>
|
||||||
|
|
||||||
<LayoutEventBlocker className="flex gap-2.5">
|
<LayoutEventBlocker className="flex gap-2.5">
|
||||||
<WdTooltipWrapper content="Enable Lazy delete">
|
<WdTooltipWrapper content="Enable Lazy delete">
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ const SIGNATURES_CHECKBOXES_PROPS: CheckboxesList = [
|
|||||||
|
|
||||||
const CONNECTIONS_CHECKBOXES_PROPS: CheckboxesList = [
|
const CONNECTIONS_CHECKBOXES_PROPS: CheckboxesList = [
|
||||||
{ prop: UserSettingsRemoteProps.delete_connection_with_sigs, label: 'Delete connections to linked signatures' },
|
{ prop: UserSettingsRemoteProps.delete_connection_with_sigs, label: 'Delete connections to linked signatures' },
|
||||||
|
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const UI_CHECKBOXES_PROPS: CheckboxesList = [
|
const UI_CHECKBOXES_PROPS: CheckboxesList = [
|
||||||
{ prop: InterfaceStoredSettingsProps.isShowMenu, label: 'Enable compact map menu bar' },
|
{ prop: InterfaceStoredSettingsProps.isShowMenu, label: 'Enable compact map menu bar' },
|
||||||
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
|
|
||||||
{ prop: InterfaceStoredSettingsProps.isShowBackgroundPattern, label: 'Show background pattern' },
|
{ prop: InterfaceStoredSettingsProps.isShowBackgroundPattern, label: 'Show background pattern' },
|
||||||
{ prop: InterfaceStoredSettingsProps.isSoftBackground, label: 'Enable soft background' },
|
{ prop: InterfaceStoredSettingsProps.isSoftBackground, label: 'Enable soft background' },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ const getPossibleWormholes = (systemStatic: SolarSystemStaticInfoRaw, wormholes:
|
|||||||
return x.src.some(x => {
|
return x.src.some(x => {
|
||||||
const [group, type] = x.split('-');
|
const [group, type] = x.split('-');
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('JOipP', `group, type`, group, type);
|
|
||||||
|
|
||||||
if (type === 'shattered') {
|
if (type === 'shattered') {
|
||||||
return systemStatic.is_shattered && group === spawnClassGroup;
|
return systemStatic.is_shattered && group === spawnClassGroup;
|
||||||
}
|
}
|
||||||
@@ -32,11 +29,6 @@ const getPossibleWormholes = (systemStatic: SolarSystemStaticInfoRaw, wormholes:
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('JOipP', `possibleWHTypes`, possibleWHTypes);
|
|
||||||
|
|
||||||
// debugger;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
statics: possibleWHTypes
|
statics: possibleWHTypes
|
||||||
.filter(x => x.respawn.some(y => y === Respawn.static))
|
.filter(x => x.respawn.some(y => y === Respawn.static))
|
||||||
|
|||||||
@@ -14,16 +14,12 @@ export enum TimeStatus {
|
|||||||
eol,
|
eol,
|
||||||
}
|
}
|
||||||
|
|
||||||
// export enum ShipSizeStatus {
|
|
||||||
// small, // frigates, destroyers - less than 5K t
|
|
||||||
// medium, // less than 20K t
|
|
||||||
// large, // less than 375K t
|
|
||||||
// capital, // less than 1.8M t
|
|
||||||
// }
|
|
||||||
|
|
||||||
export enum ShipSizeStatus {
|
export enum ShipSizeStatus {
|
||||||
small, // frigates, destroyers - less than 5K t
|
small = 0, // frigates, destroyers - less than 5K t
|
||||||
normal,
|
medium = 1, // less than 62K t
|
||||||
|
large = 2, // less than 375K t
|
||||||
|
freight = 3, // less than 1M t
|
||||||
|
capital = 4, // less than 1.8M t
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SolarSystemConnection = {
|
export type SolarSystemConnection = {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import CopyToClipboard from './copyToClipboard';
|
|||||||
import DownloadJson from './downloadJson';
|
import DownloadJson from './downloadJson';
|
||||||
import NewVersionUpdate from './newVersionUpdate';
|
import NewVersionUpdate from './newVersionUpdate';
|
||||||
import MapAction from './maps/mapAction';
|
import MapAction from './maps/mapAction';
|
||||||
|
import ShowCharactersAddAlert from './showCharactersAddAlert';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
DownloadJson,
|
DownloadJson,
|
||||||
@@ -20,4 +21,5 @@ export default {
|
|||||||
Ping,
|
Ping,
|
||||||
CopyToClipboard,
|
CopyToClipboard,
|
||||||
NewVersionUpdate,
|
NewVersionUpdate,
|
||||||
|
ShowCharactersAddAlert,
|
||||||
};
|
};
|
||||||
|
|||||||
11
assets/js/hooks/showCharactersAddAlert.ts
Normal file
11
assets/js/hooks/showCharactersAddAlert.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
mounted() {
|
||||||
|
this.pushEvent('restore_show_characters_add_alert', {
|
||||||
|
value: localStorage.getItem('wanderer:hide_characters_add_alert') !== 'true',
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById('characters-add-alert-hide')?.addEventListener('click', e => {
|
||||||
|
localStorage.setItem('wanderer:hide_characters_add_alert', 'true');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -128,11 +128,13 @@ defmodule WandererApp.Api.MapConnection do
|
|||||||
allow_nil?(true)
|
allow_nil?(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
# where 0 - Frigate
|
# where 0 - Frigate (small
|
||||||
# where 1 - Medium and Large
|
# where 1 - Medium
|
||||||
# where 2 - Capital
|
# where 2 - Large
|
||||||
|
# where 3 - Freight
|
||||||
|
# where 4 - Capital
|
||||||
attribute :ship_size_type, :integer do
|
attribute :ship_size_type, :integer do
|
||||||
default(1)
|
default(2)
|
||||||
|
|
||||||
allow_nil?(true)
|
allow_nil?(true)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ defmodule WandererApp.Api.MapSystem do
|
|||||||
action: :read_by_map_and_solar_system
|
action: :read_by_map_and_solar_system
|
||||||
)
|
)
|
||||||
|
|
||||||
|
define(:search_by_map,
|
||||||
|
action: :search_by_map
|
||||||
|
)
|
||||||
|
|
||||||
define(:update_name, action: :update_name)
|
define(:update_name, action: :update_name)
|
||||||
define(:update_description, action: :update_description)
|
define(:update_description, action: :update_description)
|
||||||
define(:update_locked, action: :update_locked)
|
define(:update_locked, action: :update_locked)
|
||||||
@@ -73,6 +77,20 @@ defmodule WandererApp.Api.MapSystem do
|
|||||||
filter(expr(map_id == ^arg(:map_id) and visible == true))
|
filter(expr(map_id == ^arg(:map_id) and visible == true))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
read :search_by_map do
|
||||||
|
argument(:map_id, :string, allow_nil?: false)
|
||||||
|
argument(:text, :string, allow_nil?: false)
|
||||||
|
|
||||||
|
filter(
|
||||||
|
expr(
|
||||||
|
(map_id == ^arg(:map_id) and
|
||||||
|
contains(string_downcase(name), string_downcase(^arg(:text)))) or
|
||||||
|
contains(string_downcase(custom_name), string_downcase(^arg(:text))) or
|
||||||
|
contains(string_downcase(description), string_downcase(^arg(:text)))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
read :read_by_map_and_solar_system do
|
read :read_by_map_and_solar_system do
|
||||||
argument(:map_id, :string, allow_nil?: false)
|
argument(:map_id, :string, allow_nil?: false)
|
||||||
argument(:solar_system_id, :integer, allow_nil?: false)
|
argument(:solar_system_id, :integer, allow_nil?: false)
|
||||||
|
|||||||
@@ -93,13 +93,9 @@ defmodule WandererAppWeb.AuthController do
|
|||||||
|> redirect(to: ~p"/")
|
|> redirect(to: ~p"/")
|
||||||
end
|
end
|
||||||
|
|
||||||
def maybe_update_character_user_id(character, user_id) do
|
def maybe_update_character_user_id(character, user_id) when not is_nil(user_id) do
|
||||||
case character.user_id do
|
|
||||||
nil ->
|
|
||||||
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
|
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
|
||||||
|
end
|
||||||
|
|
||||||
_ ->
|
def maybe_update_character_user_id(_character, _user_id), do: :ok
|
||||||
Logger.debug("character already has user_id")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ defmodule WandererAppWeb.CharactersLive do
|
|||||||
{:ok,
|
{:ok,
|
||||||
socket
|
socket
|
||||||
|> assign(
|
|> assign(
|
||||||
|
show_characters_add_alert: true,
|
||||||
mode: :blocks,
|
mode: :blocks,
|
||||||
wallet_tracking_enabled?: WandererApp.Env.wallet_tracking_enabled?(),
|
wallet_tracking_enabled?: WandererApp.Env.wallet_tracking_enabled?(),
|
||||||
characters: characters |> Enum.sort_by(& &1.name, :asc) |> Enum.map(&map_ui_character/1),
|
characters: characters |> Enum.sort_by(& &1.name, :asc) |> Enum.map(&map_ui_character/1),
|
||||||
@@ -45,6 +46,13 @@ defmodule WandererAppWeb.CharactersLive do
|
|||||||
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
|
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_event("restore_show_characters_add_alert", %{"value" => value}, socket) do
|
||||||
|
{:noreply,
|
||||||
|
socket
|
||||||
|
|> assign(show_characters_add_alert: value)}
|
||||||
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_event("authorize", form, socket) do
|
def handle_event("authorize", form, socket) do
|
||||||
track_wallet = form |> Map.get("track_wallet", false)
|
track_wallet = form |> Map.get("track_wallet", false)
|
||||||
|
|||||||
@@ -29,9 +29,45 @@
|
|||||||
id="characters-list"
|
id="characters-list"
|
||||||
class="w-full h-full col-span-2 lg:col-span-1 p-4 pl-20 pb-20 overflow-auto"
|
class="w-full h-full col-span-2 lg:col-span-1 p-4 pl-20 pb-20 overflow-auto"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
:if={@show_characters_add_alert}
|
||||||
|
role="alert"
|
||||||
|
class="alert"
|
||||||
|
id="characters-add-alert"
|
||||||
|
phx-hook="ShowCharactersAddAlert"
|
||||||
|
phx-ignore
|
||||||
|
data-key="show_characters_add_alert"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
class="h-6 w-6 shrink-0 stroke-current"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||||
|
>
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
All added characters will be automatically linked to your user account. You can't have same characters linked to several accounts.
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
class="btn btn-sm"
|
||||||
|
id="characters-add-alert-hide"
|
||||||
|
phx-click={JS.toggle_class("hidden", to: "#characters-add-alert")}
|
||||||
|
>
|
||||||
|
Hide
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
:if={@mode == :blocks}
|
:if={@mode == :blocks}
|
||||||
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 "
|
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 mt-4"
|
||||||
>
|
>
|
||||||
<.link patch={~p"/characters/authorize"}>
|
<.link patch={~p"/characters/authorize"}>
|
||||||
<div class="card card-side rounded-none h-full items-center hover:text-white bg-gradient-to-l from-stone-950 to-stone-900 transform transition duration-500">
|
<div class="card card-side rounded-none h-full items-center hover:text-white bg-gradient-to-l from-stone-950 to-stone-900 transform transition duration-500">
|
||||||
@@ -51,9 +87,24 @@
|
|||||||
<div class="absolute left-0 bottom-0 w-full h-30 bg-opacity-60 bg-gray-900">
|
<div class="absolute left-0 bottom-0 w-full h-30 bg-opacity-60 bg-gray-900">
|
||||||
<h2 class="absolute w-full flex justify-between px-4 left-0 top-10 text-xs">
|
<h2 class="absolute w-full flex justify-between px-4 left-0 top-10 text-xs">
|
||||||
Corporation:
|
Corporation:
|
||||||
|
<span
|
||||||
|
:if={
|
||||||
|
is_nil(
|
||||||
|
character
|
||||||
|
|> get(
|
||||||
|
path(:corporation_name),
|
||||||
|
nil
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
class="loading loading-dots loading-xs"
|
||||||
|
/>
|
||||||
<span>
|
<span>
|
||||||
<%= character
|
<%= character
|
||||||
|> get(path(:corporation_name), "-") %>
|
|> get(
|
||||||
|
path(:corporation_name),
|
||||||
|
""
|
||||||
|
) %>
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
<h2 class="absolute w-full flex justify-between px-4 left-0 top-16 text-xs">
|
<h2 class="absolute w-full flex justify-between px-4 left-0 top-16 text-xs">
|
||||||
@@ -65,9 +116,21 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<h2 class="absolute left-0 bottom-12 px-4 text-xs w-full flex justify-between">
|
<h2 class="absolute left-0 bottom-12 px-4 text-xs w-full flex justify-between">
|
||||||
Location:
|
Location:
|
||||||
|
<span
|
||||||
|
:if={
|
||||||
|
is_nil(
|
||||||
|
character
|
||||||
|
|> get(
|
||||||
|
path(:location / :solar_system_info / :solar_system_name, :map),
|
||||||
|
nil
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
class="loading loading-dots loading-xs"
|
||||||
|
/>
|
||||||
<span>
|
<span>
|
||||||
<%= character
|
<%= character
|
||||||
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "-") %>
|
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "") %>
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
<h2
|
<h2
|
||||||
@@ -126,7 +189,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :if={@mode == :table} class="flex flex-col gap-4">
|
<div :if={@mode == :table} class="flex flex-col gap-4 mt-4">
|
||||||
<.link patch={~p"/characters/authorize"}>
|
<.link patch={~p"/characters/authorize"}>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -66,35 +66,9 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
|
|||||||
def handle_ui_event(
|
def handle_ui_event(
|
||||||
"add_character",
|
"add_character",
|
||||||
_,
|
_,
|
||||||
%{
|
|
||||||
assigns: %{
|
|
||||||
current_user: current_user,
|
|
||||||
map_id: map_id,
|
|
||||||
user_permissions: %{track_character: true}
|
|
||||||
}
|
|
||||||
} = socket
|
|
||||||
) do
|
|
||||||
{:noreply,
|
|
||||||
socket
|
socket
|
||||||
|> assign(show_tracking?: true)
|
),
|
||||||
|> assign_async(:characters, fn ->
|
do: {:noreply, socket |> add_character()}
|
||||||
{:ok, map} =
|
|
||||||
map_id
|
|
||||||
|> WandererApp.MapRepo.get([:acls])
|
|
||||||
|
|
||||||
{:ok, character_settings} =
|
|
||||||
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
|
|
||||||
{:ok, settings} -> {:ok, settings}
|
|
||||||
_ -> {:ok, []}
|
|
||||||
end
|
|
||||||
|
|
||||||
map
|
|
||||||
|> WandererApp.Maps.load_characters(
|
|
||||||
character_settings,
|
|
||||||
current_user.id
|
|
||||||
)
|
|
||||||
end)}
|
|
||||||
end
|
|
||||||
|
|
||||||
def handle_ui_event(
|
def handle_ui_event(
|
||||||
"add_character",
|
"add_character",
|
||||||
@@ -222,6 +196,38 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
|
|||||||
def handle_ui_event(event, body, socket),
|
def handle_ui_event(event, body, socket),
|
||||||
do: MapCoreEventHandler.handle_ui_event(event, body, socket)
|
do: MapCoreEventHandler.handle_ui_event(event, body, socket)
|
||||||
|
|
||||||
|
def add_character(
|
||||||
|
%{
|
||||||
|
assigns: %{
|
||||||
|
current_user: current_user,
|
||||||
|
map_id: map_id,
|
||||||
|
user_permissions: %{track_character: true}
|
||||||
|
}
|
||||||
|
} = socket
|
||||||
|
),
|
||||||
|
do:
|
||||||
|
socket
|
||||||
|
|> assign(show_tracking?: true)
|
||||||
|
|> assign_async(:characters, fn ->
|
||||||
|
{:ok, map} =
|
||||||
|
map_id
|
||||||
|
|> WandererApp.MapRepo.get([:acls])
|
||||||
|
|
||||||
|
{:ok, character_settings} =
|
||||||
|
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
|
||||||
|
{:ok, settings} -> {:ok, settings}
|
||||||
|
_ -> {:ok, []}
|
||||||
|
end
|
||||||
|
|
||||||
|
map
|
||||||
|
|> WandererApp.Maps.load_characters(
|
||||||
|
character_settings,
|
||||||
|
current_user.id
|
||||||
|
)
|
||||||
|
end)
|
||||||
|
|
||||||
|
def add_character(socket), do: socket
|
||||||
|
|
||||||
def has_tracked_characters?([]), do: false
|
def has_tracked_characters?([]), do: false
|
||||||
def has_tracked_characters?(_user_characters), do: true
|
def has_tracked_characters?(_user_characters), do: true
|
||||||
|
|
||||||
|
|||||||
@@ -221,8 +221,9 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
|||||||
socket
|
socket
|
||||||
|> put_flash(
|
|> put_flash(
|
||||||
:error,
|
:error,
|
||||||
"You should enable tracking for at least one character."
|
"You should enable tracking for at least one character!"
|
||||||
)}
|
)
|
||||||
|
|> MapCharactersEventHandler.add_character()}
|
||||||
|
|
||||||
def handle_ui_event(event, body, socket) do
|
def handle_ui_event(event, body, socket) do
|
||||||
Logger.warning(fn -> "unhandled map ui event: #{event} #{inspect(body)}" end)
|
Logger.warning(fn -> "unhandled map ui event: #{event} #{inspect(body)}" end)
|
||||||
@@ -448,13 +449,16 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
|||||||
|> filter_map_characters(user_character_eve_ids, user_permissions, options)
|
|> filter_map_characters(user_character_eve_ids, user_permissions, options)
|
||||||
|> Enum.map(&MapCharactersEventHandler.map_ui_character/1)
|
|> Enum.map(&MapCharactersEventHandler.map_ui_character/1)
|
||||||
|
|
||||||
|
has_tracked_characters? =
|
||||||
|
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
|
||||||
|
|
||||||
|
socket =
|
||||||
socket
|
socket
|
||||||
|> assign(
|
|> assign(
|
||||||
map_loaded?: true,
|
map_loaded?: true,
|
||||||
map_user_settings: map_user_settings,
|
map_user_settings: map_user_settings,
|
||||||
user_characters: user_character_eve_ids,
|
user_characters: user_character_eve_ids,
|
||||||
has_tracked_characters?:
|
has_tracked_characters?: has_tracked_characters?
|
||||||
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
|
|
||||||
)
|
)
|
||||||
|> MapEventHandler.push_map_event(
|
|> MapEventHandler.push_map_event(
|
||||||
"init",
|
"init",
|
||||||
@@ -465,6 +469,15 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
|||||||
to: "#map-loader",
|
to: "#map-loader",
|
||||||
attr: "data-loaded"
|
attr: "data-loaded"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
case not has_tracked_characters? && user_permissions.track_character do
|
||||||
|
true ->
|
||||||
|
socket
|
||||||
|
|> MapCharactersEventHandler.add_character()
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
socket
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp handle_map_start_events(socket, map_id, events) do
|
defp handle_map_start_events(socket, map_id, events) do
|
||||||
@@ -487,10 +500,6 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
|||||||
|
|
||||||
:empty_tracked_characters ->
|
:empty_tracked_characters ->
|
||||||
socket
|
socket
|
||||||
|> put_flash(
|
|
||||||
:info,
|
|
||||||
"You should enable tracking for at least one character to work with map."
|
|
||||||
)
|
|
||||||
|
|
||||||
:map_character_limit ->
|
:map_character_limit ->
|
||||||
socket
|
socket
|
||||||
@@ -514,7 +523,7 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
|||||||
%{
|
%{
|
||||||
systems:
|
systems:
|
||||||
systems
|
systems
|
||||||
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, include_static_data?) end),
|
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system) end),
|
||||||
hubs: hubs,
|
hubs: hubs,
|
||||||
connections: connections |> Enum.map(&MapEventHandler.map_ui_connection/1),
|
connections: connections |> Enum.map(&MapEventHandler.map_ui_connection/1),
|
||||||
options: options
|
options: options
|
||||||
|
|||||||
@@ -267,6 +267,28 @@ defmodule WandererAppWeb.MapSystemsEventHandler do
|
|||||||
{:noreply, socket}
|
{:noreply, socket}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_ui_event(
|
||||||
|
"get_all_systems",
|
||||||
|
_event,
|
||||||
|
%{
|
||||||
|
assigns: %{
|
||||||
|
map_id: map_id
|
||||||
|
}
|
||||||
|
} =
|
||||||
|
socket
|
||||||
|
) do
|
||||||
|
{:ok, systems} = WandererApp.MapSystemRepo.get_all_by_map(map_id)
|
||||||
|
|
||||||
|
systems =
|
||||||
|
systems
|
||||||
|
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, false) end)
|
||||||
|
|
||||||
|
{:reply,
|
||||||
|
%{
|
||||||
|
systems: systems
|
||||||
|
}, socket}
|
||||||
|
end
|
||||||
|
|
||||||
def handle_ui_event(
|
def handle_ui_event(
|
||||||
"get_system_static_infos",
|
"get_system_static_infos",
|
||||||
%{"solar_system_ids" => solar_system_ids} = _event,
|
%{"solar_system_ids" => solar_system_ids} = _event,
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ defmodule WandererAppWeb.MapEventHandler do
|
|||||||
"add_system",
|
"add_system",
|
||||||
"delete_systems",
|
"delete_systems",
|
||||||
"manual_add_system",
|
"manual_add_system",
|
||||||
|
"get_all_systems",
|
||||||
"get_system_static_infos",
|
"get_system_static_infos",
|
||||||
"update_system_position",
|
"update_system_position",
|
||||||
"update_system_positions",
|
"update_system_positions",
|
||||||
@@ -246,17 +247,24 @@ defmodule WandererAppWeb.MapEventHandler do
|
|||||||
status: status,
|
status: status,
|
||||||
visible: visible
|
visible: visible
|
||||||
} = _system,
|
} = _system,
|
||||||
_include_static_data? \\ true
|
include_signatures? \\ true
|
||||||
) do
|
) do
|
||||||
system_static_info = get_system_static_info(solar_system_id)
|
system_static_info = get_system_static_info(solar_system_id)
|
||||||
|
|
||||||
system_signatures =
|
system_signatures =
|
||||||
|
include_signatures?
|
||||||
|
|> case do
|
||||||
|
true ->
|
||||||
system_id
|
system_id
|
||||||
|> WandererAppWeb.MapSignaturesEventHandler.get_system_signatures()
|
|> WandererAppWeb.MapSignaturesEventHandler.get_system_signatures()
|
||||||
|> Enum.filter(fn signature ->
|
|> Enum.filter(fn signature ->
|
||||||
is_nil(signature.linked_system) && signature.group == "Wormhole"
|
is_nil(signature.linked_system) && signature.group == "Wormhole"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
|
||||||
%{
|
%{
|
||||||
id: "#{solar_system_id}",
|
id: "#{solar_system_id}",
|
||||||
position: %{x: position_x, y: position_y},
|
position: %{x: position_x, y: position_y},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ defmodule WandererAppWeb.MapLive do
|
|||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def mount(%{"slug" => map_slug} = _params, _session, socket) when is_connected?(socket) do
|
def mount(%{"slug" => map_slug} = _params, _session, socket) when is_connected?(socket) do
|
||||||
Process.send_after(self(), %{event: :load_map}, Enum.random(10..500))
|
Process.send_after(self(), %{event: :load_map}, Enum.random(10..800))
|
||||||
|
|
||||||
{:ok,
|
{:ok,
|
||||||
socket
|
socket
|
||||||
@@ -76,13 +76,15 @@ defmodule WandererAppWeb.MapLive do
|
|||||||
|
|
||||||
def handle_info(:not_all_characters_tracked, %{assigns: %{map_slug: map_slug}} = socket),
|
def handle_info(:not_all_characters_tracked, %{assigns: %{map_slug: map_slug}} = socket),
|
||||||
do:
|
do:
|
||||||
{:noreply,
|
WandererAppWeb.MapEventHandler.handle_ui_event(
|
||||||
|
%{event: "add_character"},
|
||||||
|
nil,
|
||||||
socket
|
socket
|
||||||
|> put_flash(
|
|> put_flash(
|
||||||
:error,
|
:error,
|
||||||
"You should enable tracking for all characters that have access to this map first!"
|
"You should enable tracking for all characters that have access to this map first!"
|
||||||
)
|
)
|
||||||
|> push_navigate(to: ~p"/tracking/#{map_slug}")}
|
)
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_info(info, socket),
|
def handle_info(info, socket),
|
||||||
|
|||||||
@@ -92,12 +92,12 @@
|
|||||||
<.modal
|
<.modal
|
||||||
:if={assigns |> Map.get(:show_tracking?, false)}
|
:if={assigns |> Map.get(:show_tracking?, false)}
|
||||||
id="map-tracking-modal"
|
id="map-tracking-modal"
|
||||||
title="Characters tracking"
|
title="Track Characters"
|
||||||
show
|
show
|
||||||
on_cancel={JS.push("hide_tracking")}
|
on_cancel={JS.push("hide_tracking")}
|
||||||
>
|
>
|
||||||
<.async_result :let={characters} assign={@characters}>
|
<.async_result :let={characters} assign={@characters}>
|
||||||
<:loading><span class="loading loading-dots loading-xs" />.</:loading>
|
<:loading><span class="loading loading-dots loading-xs" /></:loading>
|
||||||
<:failed :let={reason}><%= reason %></:failed>
|
<:failed :let={reason}><%= reason %></:failed>
|
||||||
|
|
||||||
<.table
|
<.table
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
class="h-[400px] !overflow-y-auto"
|
class="h-[400px] !overflow-y-auto"
|
||||||
rows={characters}
|
rows={characters}
|
||||||
>
|
>
|
||||||
<:col :let={character} label="Tracked">
|
<:col :let={character} label="Track">
|
||||||
<label class="flex items-center gap-3">
|
<label class="flex items-center gap-3">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
2
mix.exs
2
mix.exs
@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
|
|||||||
use Mix.Project
|
use Mix.Project
|
||||||
|
|
||||||
@source_url "https://github.com/wanderer-industries/wanderer"
|
@source_url "https://github.com/wanderer-industries/wanderer"
|
||||||
@version "1.29.5"
|
@version "1.31.0"
|
||||||
|
|
||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -755,11 +755,11 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
|||||||
944,9,Capital Industrial Ship Blueprint,None,1,0,0,0,1
|
944,9,Capital Industrial Ship Blueprint,None,1,0,0,0,1
|
||||||
945,9,Industrial Command Ship Blueprint,None,1,0,0,0,1
|
945,9,Industrial Command Ship Blueprint,None,1,0,0,0,1
|
||||||
952,11,Mission Container,0,0,1,0,0,0
|
952,11,Mission Container,0,0,1,0,0,0
|
||||||
954,32,Defensive Subsystem,None,0,0,0,0,1
|
954,32,Defensive Subsystem,3631,0,0,0,0,1
|
||||||
955,17,Depricated Subsystems,None,0,0,0,0,0
|
955,17,Depricated Subsystems,None,0,0,0,0,0
|
||||||
956,32,Offensive Subsystem,None,0,0,0,0,1
|
956,32,Offensive Subsystem,3641,0,0,0,0,1
|
||||||
957,32,Propulsion Subsystem,None,0,0,0,0,1
|
957,32,Propulsion Subsystem,3646,0,0,0,0,1
|
||||||
958,32,Core Subsystem,None,0,0,0,0,1
|
958,32,Core Subsystem,3636,0,0,0,0,1
|
||||||
959,11,Deadspace Sleeper Sleepless Sentinel,0,0,0,0,0,0
|
959,11,Deadspace Sleeper Sleepless Sentinel,0,0,0,0,0,0
|
||||||
960,11,Deadspace Sleeper Awakened Sentinel,0,0,0,0,0,0
|
960,11,Deadspace Sleeper Awakened Sentinel,0,0,0,0,0,0
|
||||||
961,11,Deadspace Sleeper Emergent Sentinel,0,0,0,0,0,0
|
961,11,Deadspace Sleeper Emergent Sentinel,0,0,0,0,0,0
|
||||||
@@ -1529,6 +1529,8 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
|||||||
4811,9,Mercenary Den Blueprint,None,1,0,0,0,1
|
4811,9,Mercenary Den Blueprint,None,1,0,0,0,1
|
||||||
4820,9,Mutaplasmid Blueprint,None,1,0,0,0,1
|
4820,9,Mutaplasmid Blueprint,None,1,0,0,0,1
|
||||||
4821,17,Atavum,None,1,0,0,0,1
|
4821,17,Atavum,None,1,0,0,0,1
|
||||||
|
4824,17,Infomorph Systems,None,1,0,0,0,1
|
||||||
|
4825,2,Local Beacon,None,0,1,0,0,0
|
||||||
350858,350001,Infantry Weapons,None,1,0,0,0,0
|
350858,350001,Infantry Weapons,None,1,0,0,0,0
|
||||||
351064,350001,Infantry Dropsuits,None,1,0,0,0,0
|
351064,350001,Infantry Dropsuits,None,1,0,0,0,0
|
||||||
351121,350001,Infantry Modules,None,1,0,0,0,0
|
351121,350001,Infantry Modules,None,1,0,0,0,0
|
||||||
|
|||||||
|
File diff suppressed because it is too large
Load Diff
21
priv/repo/migrations/20241217103838_ship_size.exs
Normal file
21
priv/repo/migrations/20241217103838_ship_size.exs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
defmodule WandererApp.Repo.Migrations.ShipSize do
|
||||||
|
@moduledoc """
|
||||||
|
Updates resources based on their most recent snapshots.
|
||||||
|
|
||||||
|
This file was autogenerated with `mix ash_postgres.generate_migrations`
|
||||||
|
"""
|
||||||
|
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def up do
|
||||||
|
alter table(:map_chain_v1) do
|
||||||
|
modify :ship_size_type, :bigint, default: 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
alter table(:map_chain_v1) do
|
||||||
|
modify :ship_size_type, :bigint, default: 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
178
priv/resource_snapshots/repo/map_chain_v1/20241217103838.json
Normal file
178
priv/resource_snapshots/repo/map_chain_v1/20241217103838.json
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
{
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"gen_random_uuid()\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": true,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "id",
|
||||||
|
"type": "uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "solar_system_source",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "solar_system_target",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "0",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "mass_status",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "0",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "time_status",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "2",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "ship_size_type",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "0",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "type",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "wormhole_type",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "0",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "count_of_passage",
|
||||||
|
"type": "bigint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "locked",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "custom_info",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "inserted_at",
|
||||||
|
"type": "utc_datetime_usec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "updated_at",
|
||||||
|
"type": "utc_datetime_usec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": {
|
||||||
|
"deferrable": false,
|
||||||
|
"destination_attribute": "id",
|
||||||
|
"destination_attribute_default": null,
|
||||||
|
"destination_attribute_generated": null,
|
||||||
|
"index?": false,
|
||||||
|
"match_type": null,
|
||||||
|
"match_with": null,
|
||||||
|
"multitenancy": {
|
||||||
|
"attribute": null,
|
||||||
|
"global": null,
|
||||||
|
"strategy": null
|
||||||
|
},
|
||||||
|
"name": "map_chain_v1_map_id_fkey",
|
||||||
|
"on_delete": null,
|
||||||
|
"on_update": null,
|
||||||
|
"primary_key?": true,
|
||||||
|
"schema": "public",
|
||||||
|
"table": "maps_v1"
|
||||||
|
},
|
||||||
|
"size": null,
|
||||||
|
"source": "map_id",
|
||||||
|
"type": "uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"base_filter": null,
|
||||||
|
"check_constraints": [],
|
||||||
|
"custom_indexes": [],
|
||||||
|
"custom_statements": [],
|
||||||
|
"has_create_action": true,
|
||||||
|
"hash": "3495268959E42B3B8D31B5B154B416A5BEF80D57D684375296EA5C1711FE3521",
|
||||||
|
"identities": [],
|
||||||
|
"multitenancy": {
|
||||||
|
"attribute": null,
|
||||||
|
"global": null,
|
||||||
|
"strategy": null
|
||||||
|
},
|
||||||
|
"repo": "Elixir.WandererApp.Repo",
|
||||||
|
"schema": null,
|
||||||
|
"table": "map_chain_v1"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user