From 8103bf80277b759bb9c3b1e032612721f132f256 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 15 Mar 2019 18:41:39 +0100 Subject: [Broken] Got 'battle' to compile again. --- src/map-editor/src/View/SubMenu/Markers.elm | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/map-editor/src/View/SubMenu/Markers.elm (limited to 'src/map-editor') 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)) + ) + ) -- cgit v1.2.3-70-g09d2