summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-03-15 18:41:39 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-03-15 18:41:39 +0100 |
commit | 8103bf80277b759bb9c3b1e032612721f132f256 (patch) | |
tree | a1b1858483281e61a0dcb9cb42fb6df38214c06a /src/map-editor | |
parent | 6678cfe464ed9ee595f4f3dd7398dec1416454c9 (diff) |
[Broken] Got 'battle' to compile again.
Diffstat (limited to 'src/map-editor')
-rw-r--r-- | src/map-editor/src/View/SubMenu/Markers.elm | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/map-editor/src/View/SubMenu/Markers.elm b/src/map-editor/src/View/SubMenu/Markers.elm new file mode 100644 index 0000000..f975eef --- /dev/null +++ b/src/map-editor/src/View/SubMenu/Markers.elm @@ -0,0 +1,53 @@ +module View.SubMenu.Markers exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Dict + +import Html +import Html.Attributes +import Html.Events + +-- Map Editor ------------------------------------------------------------------ +import Struct.Event +import Struct.Model +import Struct.Tile +import Struct.TileInstance + +import View.Map.Tile + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_marker_html : ( + (String, Struct.MapMarker.Type) + -> (Html.Html Struct.Event.Type) + ) +get_marker_html (ref, marker) = + (Html.div + [ + (Html.Attributes.class "tile"), + (Html.Attributes.class "tiled"), + (Html.Attributes.class "clickable"), + (Html.Attributes.class "tile-variant-0"), + (Html.Events.onClick + (Struct.Event.TemplateRequested ((Struct.Tile.get_id tile), "0")) + ) + ] + (View.Map.Tile.get_content_html (Struct.TileInstance.default tile)) + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type) +get_html model = + (Html.div + [ + (Html.Attributes.class "tabmenu-content"), + (Html.Attributes.class "tabmenu-markers-tab") + ] + (List.map + (get_marker_html) + (Dict.toList (Struct.Map.get_markers model.map)) + ) + ) |