Skip to content

Commit 3447f22

Browse files
feat(map,data): add union border color settings, separate from sector border color
1 parent a2e69e6 commit 3447f22

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/renderer/src/intl/en-US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export default {
253253
sectorBorderStroke: 'Sector Borders',
254254
sectorBorderColor: 'Sector Border Color',
255255
unionBorderStroke: 'Union Borders',
256+
unionBorderColor: 'Union Border Color',
256257
unionMode: 'Union Mode',
257258
unionSubjects: 'Subjects',
258259
unionFederations: 'Federations',

src/renderer/src/lib/map/CountryBorders.svelte

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
return $mapSettings.sectorBorderStroke.enabled;
1919
}
2020
}
21+
22+
function sortSectorBorders(a: { isUnionBorder: boolean }, b: { isUnionBorder: boolean }) {
23+
return (a.isUnionBorder ? 1 : -1) - (b.isUnionBorder ? 1 : -1);
24+
}
2125
</script>
2226

2327
{#if $mapSettings.borderStroke.enabled}
@@ -56,7 +60,7 @@
5660
})}
5761
/>
5862
{/if}
59-
{#each border.sectorBorders.filter(filterSectorBorders) as sectorBorder}
63+
{#each border.sectorBorders.filter(filterSectorBorders).sort(sortSectorBorders) as sectorBorder}
6064
<Glow
6165
enabled={sectorBorder.isUnionBorder && $mapSettings.unionBorderStroke.enabled
6266
? $mapSettings.unionBorderStroke.glow
@@ -76,7 +80,12 @@
7680
mapSettings: $mapSettings,
7781
colors,
7882
countryColors: border,
79-
colorStack: [$mapSettings.sectorBorderColor, $mapSettings.borderFillColor],
83+
colorStack: [
84+
sectorBorder.isUnionBorder && $mapSettings.unionBorderStroke.enabled
85+
? $mapSettings.unionBorderColor
86+
: $mapSettings.sectorBorderColor,
87+
$mapSettings.borderFillColor,
88+
],
8089
})}
8190
fill="none"
8291
/>

src/renderer/src/lib/settings/mapSettings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export type ColorMapSettings =
5757
| 'hyperlaneColor'
5858
| 'hyperRelayColor'
5959
| 'sectorBorderColor'
60+
| 'unionBorderColor'
6061
| 'unownedHyperlaneColor'
6162
| 'unownedHyperRelayColor'
6263
| 'wormholeStrokeColor'
@@ -258,6 +259,10 @@ export const defaultMapSettings: MapSettings = {
258259
dashed: false,
259260
dashArray: '3 3',
260261
},
262+
unionBorderColor: {
263+
color: 'border',
264+
colorAdjustments: [{ type: 'MIN_CONTRAST', value: 0.25 }],
265+
},
261266
terraIncognita: true,
262267
terraIncognitaPerspectiveCountry: 'player',
263268
terraIncognitaStyle: 'striped',

src/renderer/src/lib/settings/mapSettingsConfig.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export const mapSettingsConfig: MapSettingConfigGroup[] = [
5454
!settings.unionMode ||
5555
(settings.unionFederations === 'off' && settings.unionSubjects === 'off'),
5656
},
57+
{
58+
id: 'unionBorderColor',
59+
type: 'color',
60+
hideIf: (settings) =>
61+
!settings.unionBorderStroke.enabled ||
62+
!settings.unionMode ||
63+
(settings.unionFederations === 'off' && settings.unionSubjects === 'off'),
64+
},
5765
],
5866
},
5967
{

0 commit comments

Comments
 (0)