From fabfc355797b86a471d8ad573882cfac2852bd82 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 15 Jul 2023 08:23:24 +0200 Subject: [PATCH] Chess: Improved chess figurines for notation --- LICENSE | 4 ++++ src/chess.lua | 6 +++--- textures/chess_figurine_bishop_black.png | Bin 0 -> 200 bytes textures/chess_figurine_bishop_white.png | Bin 0 -> 180 bytes textures/chess_figurine_king_black.png | Bin 0 -> 210 bytes textures/chess_figurine_king_white.png | Bin 0 -> 192 bytes textures/chess_figurine_knight_black.png | Bin 0 -> 195 bytes textures/chess_figurine_knight_white.png | Bin 0 -> 196 bytes textures/chess_figurine_pawn_black.png | Bin 0 -> 161 bytes textures/chess_figurine_pawn_white.png | Bin 0 -> 162 bytes textures/chess_figurine_queen_black.png | Bin 0 -> 213 bytes textures/chess_figurine_queen_white.png | Bin 0 -> 195 bytes textures/chess_figurine_rook_black.png | Bin 0 -> 167 bytes textures/chess_figurine_rook_white.png | Bin 0 -> 164 bytes 14 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 textures/chess_figurine_bishop_black.png create mode 100644 textures/chess_figurine_bishop_white.png create mode 100644 textures/chess_figurine_king_black.png create mode 100644 textures/chess_figurine_king_white.png create mode 100644 textures/chess_figurine_knight_black.png create mode 100644 textures/chess_figurine_knight_white.png create mode 100644 textures/chess_figurine_pawn_black.png create mode 100644 textures/chess_figurine_pawn_white.png create mode 100644 textures/chess_figurine_queen_black.png create mode 100644 textures/chess_figurine_queen_white.png create mode 100644 textures/chess_figurine_rook_black.png create mode 100644 textures/chess_figurine_rook_white.png diff --git a/LICENSE b/LICENSE index 7483d9f..0bbaa90 100644 --- a/LICENSE +++ b/LICENSE @@ -7,6 +7,10 @@ │ Textures (radio and speaker) by │ │ MCL (CC BY 4.0 Int'l) │ │ │ +│ Textures (Chess icons for the Chess notation) │ +│ originally by Wikimedia user Cbnurnett, │ +│ scaled down and edited by Wuzzy (CC BY-SA 3.0 Unported) │ +│ │ │ Textures (hanging candle) by │ │ Wuzzy (CC0) │ │ │ diff --git a/src/chess.lua b/src/chess.lua index 492fed5..497f609 100644 --- a/src/chess.lua +++ b/src/chess.lua @@ -802,7 +802,7 @@ local pieces_str, x = "", 0 for i = 1, #pieces do local p = pieces[i]:match(":(%w+_%w+)") if pieces[i]:find(":(%w+)_(%w+)") and not pieces_str:find(p) then - pieces_str = pieces_str .. x .. "=" .. p .. ".png," + pieces_str = pieces_str .. x .. "=chess_figurine_" .. p .. ".png," x = x + 1 end end @@ -900,9 +900,9 @@ local function get_moves_formstring(meta) if pieceFrom:sub(11,14) == "pawn" then pieceFrom_si_id = MOVES_LIST_SYMBOL_EMPTY else - pieceFrom_si_id = pieces_str:match("(%d+)=" .. pieceFrom_s) + pieceFrom_si_id = pieces_str:match("(%d+)=chess_figurine_" .. pieceFrom_s) end - local pieceTo_si_id = pieceTo_s ~= "" and pieces_str:match("(%d+)=" .. pieceTo_s) or "" + local pieceTo_si_id = pieceTo_s ~= "" and pieces_str:match("(%d+)=chess_figurine_" .. pieceTo_s) or "" local coordFrom = index_to_notation(from_idx) local coordTo = index_to_notation(to_idx) diff --git a/textures/chess_figurine_bishop_black.png b/textures/chess_figurine_bishop_black.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4895fe4cfc4f350a3999a986ffb1463c8937c5 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`{hlt4Ar`0i20HQ`HsCoFY=2?# zPq%;nW!F_Vl}Bos7v0`6>zQy@g93x!xw{YFRg}Er^HkK7o9V&Dz^JhAM?dE-3-uXh zl1I1uteU@m(v1k2lYQk!{`eJL-rIMnFhpQay5p8Cb^LwxmdKI;Vst0CYrD A=Kufz literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_bishop_white.png b/textures/chess_figurine_bishop_white.png new file mode 100644 index 0000000000000000000000000000000000000000..7d753d92b499808c8bd7a2b068a292e2b3d7d9a7 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`)t)YnAr_~P272-}DDdR;%0IaA z^Z)G^7u6qd25TuSIyO)0l4P3VuOb(fPLEk^&nsO%^)qqr^LUD-xMvM?27{-opUXO@geCy<&P6@| literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_king_black.png b/textures/chess_figurine_king_black.png new file mode 100644 index 0000000000000000000000000000000000000000..974aeb019a2d3baaee0ec30b745e9772f0e14269 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Gd*1#Lo7}&4L-t@moRWNcxXMAt>CQIUU=q7oPc0a zIRk^|*R2zas|;Sfot4fXCgZt7q`xK9uGnkY*}IOP&g9#k;M;ka@xU+N{R^(n@N{xn z@Up6BeRza#yx8XuInV6f+rF#yy|cfm{eRc|f31Zv+n<@%Fnq~BCzV{_y9?+@22WQ% Jmvv4FO#m1QQ#Akp literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_king_white.png b/textures/chess_figurine_king_white.png new file mode 100644 index 0000000000000000000000000000000000000000..889932fa814adb34c88852d929d62079246dce90 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`?Vc`;_dw9WUKu~CC93w)y3zWHqDS^a0s2hect0& zxwG8)ZThV52=A$SvSg;2aq}v>uRNMY8d7i0Yvf+$d)4Fdm62ha(Dz-3-bfigKBVGS rv?s3XPW;QI!QbrzzbWlay2o4kZikx61MyQpCoy=s`njxgN@xNAiD^op literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_knight_black.png b/textures/chess_figurine_knight_black.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebb32a03f64a7d83e7ca111e79c4d679a79c931 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`U7jwEAr`0SPP)i@RDp+i{ncot zH~Ryo7aa50ALTm5DNfhbqeG&Yv7w`4%90bWS1^>R6@6c@=;GT0v6GUfq-0z$|Lzvt zeCJQv6yIe$QQ1?rcKw_7=-R8hlmGsdP}RNs{%1kngqE4Psm(mTmlD%v?{?>W#%fqU vL-b0w<4g5_tQ%!^r+-)~`QUqMNu)a4Pl>r9H{)jkUB%$(>gTe~DWM4fLrGG2 literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_knight_white.png b/textures/chess_figurine_knight_white.png new file mode 100644 index 0000000000000000000000000000000000000000..933bf348789542ce3a349352a044e5d978e1e64c GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`-JULvAr`0SPCCeY*no$5<^u1I z-}+Zn*BIUi=Q0aSG5;fB;L~I!IVnI>=}Ee(=Z%XijQ=kQaSL}@!8N&r*JAd0$J~b5 z@0)Cvq#7JMFsY9%_Umr3`+{l3=HLHHdHSi}_`6ZsL&gTe~DWM4f$z4k0 literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_pawn_black.png b/textures/chess_figurine_pawn_black.png new file mode 100644 index 0000000000000000000000000000000000000000..ed4d1854ca9de9d79490c6e50fd8197f9d2801ae GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`8J;eVAr`0KPH^OFFyLSjf2_Xa z=l}MD#@8nEE;W<7ID2+MW7$ksh6a^QclMfwhJK1s+2T=_n#OYB)R`IgWugK?ZYFe0 z_?T|EPjN=B{o)__2QEH%Rc!WBX~*xdu7dLFB^7TwvKLgOY+zon{KNs(V*zGBI~hD( L{an^LB{Ts5majl| literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_pawn_white.png b/textures/chess_figurine_pawn_white.png new file mode 100644 index 0000000000000000000000000000000000000000..aeb4929344d258299c57ee06ed0980ccc94dec23 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`nVv3=Ar_~vPH+@zFyLT5_)+-f z$^Z2|=|_TPy>4HeSY@zWCc!gc(xO#DtPNLZN18hr&DikfX`-A%keR0z?+dLXKQ>F9 z)-vHtyY8;J&-251`Iv^?PdPHR7%YNB=f!>3oMv0Ne%X{yTm?)S%fw!toVfWd&{76Z LS3j3^P6#95z literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_queen_black.png b/textures/chess_figurine_queen_black.png new file mode 100644 index 0000000000000000000000000000000000000000..452fde2b84f094dae548a8a9ffcf0d1bfd86f49a GIT binary patch literal 213 zcmV;`04o29P)PdhTvz_u)-G0GOoZ@O51P0FqN6ceh~!-SzJL ztd3iegtC&^*>jzvoF1Y{nwpbYqYrU&^{a8Ke*NOXE{;9O3ZC=b`4%5HhLOS&@=`4O P00000NkvXXu0mjf%fnZd literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_queen_white.png b/textures/chess_figurine_queen_white.png new file mode 100644 index 0000000000000000000000000000000000000000..e888f009e0f71c58337776c08cba3f2daee31fb0 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`U7jwEAr`0C1|8%*V!)vsINjj) zdADN^;vDT>cSL>tt((0qh@&P zZkGB2tt)mZaeHt4F)=RwKC3(Z&7%&Dv(q(s?lwJo&h@^@dR9Jveuns6+Ye{5*ItUf uyK#l5Z2jGxyM*Ja7s&FIpI6^k%do8CLD#(frM^H{F?hQAxvX7~B^{3K5?`J6}Q4Ia`OkNe72tLd%%{Wf9iCxcU0Pc8Pl_0E0=!;a^^ZIA!t Rp9k8^;OXk;vd$@?2>|)WLrDMt literal 0 HcmV?d00001 diff --git a/textures/chess_figurine_rook_white.png b/textures/chess_figurine_rook_white.png new file mode 100644 index 0000000000000000000000000000000000000000..4d4736944b742bf6c64e671f404651aa70232c09 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`*`6+rAr`0KPCCfTpvb`@o-BN! zJ~yE4yQR>%45o+GpNmub8+ht~A|kdd0+x_RKCU zx-%+MZ{A;Sl9Df%@rj>7c#M3pOGbevz<9AtAZJt@Rdn(Xc N22WQ%mvv4FO#oMaK3o6* literal 0 HcmV?d00001