aboutsummaryrefslogtreecommitdiff
blob: be698bfa5a241f83801b0e492b7ee40e9e02c3f3 (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
module View.Controls exposing (view)

import Html
import Html.Events

import Battlemap.Direction

import Event

direction_button : Battlemap.Direction.Type -> String -> (Html.Html Event.Type)
direction_button dir label =
   (Html.button
      [
         (Html.Events.onClick
            (Event.DirectionRequest dir)
         )
      ]
      [ (Html.text label) ]
   )

end_turn_button : (Html.Html Event.Type)
end_turn_button =
   (Html.button
      [ (Html.Events.onClick Event.EndTurn) ]
      [ (Html.text "End Turn") ]
   )

view : (List (Html.Html Event.Type))
view =
   [
      (direction_button Battlemap.Direction.Left "Left"),
      (direction_button Battlemap.Direction.Down "Down"),
      (direction_button Battlemap.Direction.Up "Up"),
      (direction_button Battlemap.Direction.Right "Right"),
      (end_turn_button)
   ]