summaryrefslogtreecommitdiff
blob: d38d84e0f5f38e6948f8662f3c852dc963dfb080 (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
module View.Battlemap.Tile exposing (get_html)

import Html
import Html.Attributes
import Html.Events

import Battlemap.Tile
import Battlemap.Location

import Event

get_html : (
      Int ->
      Battlemap.Tile.Type ->
      (Html.Html Event.Type)
   )
get_html tile_size tile =
   let
      tile_loc = (Battlemap.Tile.get_location tile)
   in
      (Html.div
         [
            (Html.Attributes.class "battlemap-tile-icon"),
            (Html.Attributes.class
               ("asset-tile-" ++ (toString (Battlemap.Tile.get_icon_id tile)))
            ),
            (Html.Events.onClick
               (Event.TileSelected (Battlemap.Location.get_ref tile_loc))
            ),
            (Html.Attributes.style
               [
                  ("top", ((toString (tile_loc.y * tile_size)) ++ "px")),
                  ("left", ((toString (tile_loc.x * tile_size)) ++ "px"))
               ]
            )
         ]
         [
         ]
      )