File tree Expand file tree Collapse file tree
src/renderer/src/lib/map/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 "editor.defaultFormatter" : " rust-lang.rust-analyzer"
2828 },
2929 "eslint.run" : " onType" ,
30- "editor.codeActionsOnSave" : {
31- "source.organizeImports" : " explicit"
32- }
30+ "editor.codeActionsOnSave" : {}
3331}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export function localizeTextSync(
4545 }
4646 }
4747 let value = loc [ text . key ] ;
48- if ( value == null ) return removeColorCodes ( text . key ) ;
48+ if ( value == null ) return removeColorAndIconCodes ( text . key ) ;
4949 if ( text . variables ) {
5050 text . variables . forEach ( ( variable ) => {
5151 const localizedVariable = localizeTextSync ( variable . value , loc ) ;
@@ -55,9 +55,9 @@ export function localizeTextSync(
5555 . replace ( `<${ variable . key } >` , localizedVariable ) ;
5656 } ) ;
5757 }
58- return removeColorCodes ( value ) ;
58+ return removeColorAndIconCodes ( value ) ;
5959}
6060
61- function removeColorCodes ( text : string ) : string {
62- return text . replace ( / [ \u0011 § ] ./ g, '' ) ; // eslint-disable-line no-control-regex
61+ export function removeColorAndIconCodes ( text : string ) : string {
62+ return text . replace ( / [ \u0011 § ] .? / g , '' ) . replace ( / \u0013 \w * / g, '' ) ; // eslint-disable-line no-control-regex
6363}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import polylabel from 'polylabel';
33
44import type { GameState } from '../../GameState' ;
55import type { MapSettings } from '../../settings' ;
6+ import { removeColorAndIconCodes } from './locUtils' ;
67import type processBorders from './processBorders' ;
78import type processSystemOwnership from './processSystemOwnership' ;
89import type processTerraIncognita from './processTerraIncognita' ;
@@ -58,7 +59,9 @@ export default function processLabels(
5859 ) ;
5960 const labels = idGeojsonPairs . map ( ( [ countryId , geojson ] ) => {
6061 const countryName = countryNames [ countryId ] ?? '' ;
61- const playerName = gameState . player . find ( ( player ) => player . country === countryId ) ?. name ?? '' ;
62+ const playerName = removeColorAndIconCodes (
63+ gameState . player . find ( ( player ) => player . country === countryId ) ?. name ?? '' ,
64+ ) ;
6265 let primaryName = '' ;
6366 let secondaryName = '' ;
6467 switch ( settings . countryNamesType ) {
You can’t perform that action at this time.
0 commit comments