@@ -541,13 +541,19 @@ function mergeMoveRecursive2(gameEngine, exploration, moveNum, node, children) {
541541 return movesUpdated ;
542542}
543543
544- function setupColors ( settings , game , t ) {
544+ function setupColors ( settings , game , globalMe ) {
545545 var options = { } ;
546546 if ( settings . color === "blind" ) {
547547 options . colourBlind = true ;
548548 // } else if (settings.color === "patterns") {
549549 // options.patterns = true;
550550 }
551+ if ( settings . color !== "standard" && settings . color !== "blind" ) {
552+ const palette = globalMe . palettes . find ( p => p . name === settings . color ) ;
553+ if ( palette !== undefined ) {
554+ options . colours = [ ...palette . colours ] ;
555+ }
556+ }
551557 game . colors = game . players . map ( ( p , i ) => {
552558 if ( game . sharedPieces ) {
553559 return { isImage : false , value : game . seatNames [ i ] } ;
@@ -834,7 +840,8 @@ function processNewSettings(
834840 gameRef ,
835841 settingsSetter ,
836842 gameSettingsSetter ,
837- userSettingsSetter
843+ userSettingsSetter ,
844+ globalMe
838845) {
839846 gameSettingsSetter ( newGameSettings ) ;
840847 userSettingsSetter ( newUserSettings ) ;
@@ -866,7 +873,7 @@ function processNewSettings(
866873 newGameSettings === undefined || newGameSettings . rotate === undefined
867874 ? 0
868875 : newGameSettings . rotate ;
869- setupColors ( newSettings , game ) ;
876+ setupColors ( newSettings , game , globalMe ) ;
870877 settingsSetter ( newSettings ) ;
871878 return newSettings ;
872879 }
@@ -1198,7 +1205,8 @@ function GameMove(props) {
11981205 gameRef ,
11991206 settingsSetter ,
12001207 gameSettingsSetter ,
1201- userSettingsSetter
1208+ userSettingsSetter ,
1209+ globalMe
12021210 ) ;
12031211 if ( data . comments !== undefined ) {
12041212 commentsSetter ( data . comments ) ;
@@ -1672,6 +1680,13 @@ function GameMove(props) {
16721680 // } else if (settings.color === "patterns") {
16731681 // options.patterns = true;
16741682 }
1683+ if ( ( settings . color !== "standard" ) && ( settings . color !== "blind" ) ) {
1684+ console . log ( `Looking for a palette named ${ settings . color } ` ) ;
1685+ const palette = globalMe . palettes ?. find ( p => p . name === settings . color ) ;
1686+ if ( palette !== undefined ) {
1687+ options . colours = [ ...palette . colours ] ;
1688+ }
1689+ }
16751690 if ( gameRef . current . stackExpanding ) {
16761691 options . boardHover = ( row , col , piece ) => {
16771692 expand ( col , row ) ;
@@ -1731,7 +1746,8 @@ function GameMove(props) {
17311746 gameRef ,
17321747 settingsSetter ,
17331748 gameSettingsSetter ,
1734- userSettingsSetter
1749+ userSettingsSetter ,
1750+ globalMe
17351751 ) ;
17361752 if ( game . me > - 1 ) {
17371753 try {
@@ -1767,7 +1783,8 @@ function GameMove(props) {
17671783 gameRef ,
17681784 settingsSetter ,
17691785 gameSettingsSetter ,
1770- userSettingsSetter
1786+ userSettingsSetter ,
1787+ globalMe
17711788 ) ;
17721789 if ( newSettings ?. display ) {
17731790 console . log ( "settings.display" , newSettings . display ) ;
0 commit comments