1 import("piece_theme.lua")
2 import("shogi_themelib.lua")
10 theme
.options
= OptList
{
11 BoolOpt("moves_overlay", "Moves overlay", true),
12 BoolOpt("single_kanji", "Single kanji on tiles", false),
13 SelectOpt("symbols", "Symbol set", BoolOptList
{
14 -- BoolOpt("use_predefined", "Predefined", true, OptList {
15 -- ComboOpt("font", "Symbol set", fontnames)
17 BoolOpt("use_custom", "Custom font", false, OptList
{
18 UrlOpt("file", "SVG glyph directory", "../../figurines/ShogiTTF/mikachan.ttf")
20 -- BoolOpt("use_system", "System font", false, OptList {
21 -- FontOpt("font", "System font", Font("Arial", true, true))
26 function addChar(single
, promoted
)
27 return function(i
, size
)
28 font
= theme
.options
.symbols
.options
.use_custom
.sub_options
.file
.value
29 i
:draw_glyph(Rect(size
*0.2,size
*0.25,size
*0.6,size
*0.6), font
, single
,
30 promoted
and "#d00000" or "#004000",
36 function shogi_piece(char
, white
, promoted
, ratio
, moves
)
37 return addShadow(overlay(tile(white
, ratio
),
39 addChar(char
, promoted
)))
43 theme
.black_phoenix
= shogi_piece(shogichars
["tori phoenix"][1],
44 false, false, 1, shogimoves_king
)
45 theme
.black_falcon
= shogi_piece(shogichars
["tori falcon"][1],
46 false, false, 1, shogimoves_drunken_elephant
)
47 theme
.black_p_falcon
= shogi_piece(shogichars
["tori eagle"][1],
48 false, true, 1, shogimoves_eagle
)
49 theme
.black_crane
= shogi_piece(shogichars
["tori crane"][1],
50 false, false, 1, shogimoves_crane
)
51 theme
.black_right_quail
= shogi_piece(shogichars
["tori quail"][1],
52 false, false, 1, shogimoves_right_quail
)
53 theme
.black_left_quail
= shogi_piece(shogichars
["tori quail"][1],
54 false, false, 1, shogimoves_left_quail
)
55 theme
.black_pheasant
= shogi_piece(shogichars
["tori pheasant"][1],
56 false, false, 1, shogimoves_pheasant
)
57 theme
.black_swallow
= shogi_piece(shogichars
["tori swallow"][1],
58 false, false, 1, shogimoves_pawn
)
59 theme
.black_p_swallow
= shogi_piece(shogichars
["tori goose"][1],
60 false, true, 1, shogimoves_goose
)
62 theme
.white_phoenix
= shogi_piece(shogichars
["tori phoenix"][1],
63 true, false, 1, shogimoves_king
)
64 theme
.white_falcon
= shogi_piece(shogichars
["tori falcon"][1],
65 true, false, 1, shogimoves_drunken_elephant
)
66 theme
.white_p_falcon
= shogi_piece(shogichars
["tori eagle"][1],
67 true, true, 1, shogimoves_eagle
)
68 theme
.white_crane
= shogi_piece(shogichars
["tori crane"][1],
69 true, false, 1, shogimoves_crane
)
70 theme
.white_right_quail
= shogi_piece(shogichars
["tori quail"][1],
71 true, false, 1, shogimoves_right_quail
)
72 theme
.white_left_quail
= shogi_piece(shogichars
["tori quail"][1],
73 true, false, 1, shogimoves_left_quail
)
74 theme
.white_pheasant
= shogi_piece(shogichars
["tori pheasant"][1],
75 true, false, 1, shogimoves_pheasant
)
76 theme
.white_swallow
= shogi_piece(shogichars
["tori swallow"][1],
77 true, false, 1, shogimoves_pawn
)
78 theme
.white_p_swallow
= shogi_piece(shogichars
["tori goose"][1],
79 true, true, 1, shogimoves_goose
)