summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wargame/source/chit/misc.dtx
blob: a5b9a79b24a466f95280d006be2744c09f73af11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% \iffalse
% <*chit>
% --------------------------------------------------------------------
% \fi
% \subsubsection{Some utilities}
%
%
% Game turn marker
%
%    \begin{macrocode}
\tikzset{
  chit/text base/.style={
    shape=rectangle,
    inner sep=0pt,
    align=center,
    text width=1.1cm},
  chit/number/.style={
    chit/text base,
    font=\sffamily\bfseries\fontsize{12}{14}\selectfont},
  chit/game turn/.style={
    chit/text base,
    font=\sffamily\bfseries},
  chit/text/.style={
    chit/text base,
    font=\sffamily\bfseries},
  chit/small text/.style={
    chit/text base,
    font=\sffamily\bfseries\fontsize{9}{10}\selectfont},
  chit/number/.pic={\node[chit/number]{#1};},
  chit/game turn/.pic={\node[chit/game turn]{Game\\Turn};},
  chit/text/.pic={\node[chit/text]{#1};},
  chit/small text/.pic={\node[chit/small text]{#1};},
  game turn chit/.style={
    /chit/full={chit/game turn},
    color=black,
    fill=white},
  game turn chit flipped/.style={game turn chit},
  dummy chit/.style={fill=white},
}
%    \end{macrocode}
%
% Marks of chits
% 
%    \begin{macrocode}
\providecommand\chitmark[2][]{\tikz[scale=.25,#1]{\chit[#2]}}
%    \end{macrocode}
%
% Stacking mark
% 
%    \begin{macrocode}
\tikzset{
  wg stacking/.style={fill=white,
    /chit/symbol={[faction=friendly,command=land]}},
}
\DeclareRobustCommand\stackmark[1][]{%
  \tikz[baseline=(current bounding box.center),scale=.3,#1]{
    \stackchits(0,0)(.3,-.3){%
      \noexpand\chit[wg stacking],
      \noexpand\chit[wg stacking],
      \noexpand\chit[wg stacking]}}}
%    \end{macrocode}
%
%  ZOC mark
%
%    \begin{macrocode}
\DeclareRobustCommand\zocmark[1][]{%
  \tikz[baseline=($(current bounding box.center)!.5!(current bounding box.south)$),scale=.1,#1]{%
    \begin{scope}[hex/first row and column are=0,
      hex/row direction is=normal,
      hex/column direction is=normal,
      hex/short columns=none]
      \hex[label=,fill=gray](c=1,r=1)%
      \hex[label=,fill=white](c=1,r=2)%
      \hex[label=,fill=white](c=1,r=0)%
      \hex[label=,fill=white](c=0,r=0)%
      \hex[label=,fill=white](c=0,r=1)%
      \hex[label=,fill=white](c=2,r=1)%
      \hex[label=,fill=white](c=2,r=0)
    \end{scope}}}
%    \end{macrocode}
%
% Dummy implementations of zones hooks when exporting.  Here, these do
% nothing, but in the \textsf{wgexport} class these are
% re-implemented.
% 
%    \begin{macrocode}
\tikzset{
  zone point/.code n args={3}{},
  zone oob point/.code n args={3}{}}
%    \end{macrocode}
%
% \iffalse
% </chit>
% \fi