From b6fa3b730fe0c4249e714545ca88d2729c815a9b Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sun, 17 Mar 2019 00:55:26 +0100 Subject: ... --- src/map-editor/src/View/SelectableTile.elm | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/map-editor/src/View/SelectableTile.elm (limited to 'src/map-editor') diff --git a/src/map-editor/src/View/SelectableTile.elm b/src/map-editor/src/View/SelectableTile.elm new file mode 100644 index 0000000..79acef5 --- /dev/null +++ b/src/map-editor/src/View/SelectableTile.elm @@ -0,0 +1,54 @@ +module View.SelectableTile exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes +import Html.Events + +-- Battle Map ------------------------------------------------------------------ +import BattleMap.Struct.TileInstance +import BattleMap.Struct.Location + +import BattleMap.View.Tile + +-- Local Module ---------------------------------------------------------------- +import Constants.UI +import Constants.IO + +import Struct.Event +import Struct.Toolbox + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +get_html : ( + Bool -> + Struct.Toolbox.Type -> + BattleMap.Struct.TileInstance.Type -> + (Html.Html Struct.Event.Type) + ) +get_html display_cost tb tile = + let + tile_loc = (BattleMap.Struct.TileInstance.get_location tile) + in + (BattleMap.View.Tile.get_html_with_extra + display_cost + [ + ( + if (Struct.Toolbox.is_selected tile_loc tb) + then (Html.Attributes.class "tile-selected") + else (Html.Attributes.class "") + ), + ( + if (Struct.Toolbox.is_square_corner tile_loc tb) + then (Html.Attributes.class "tile-square-corner") + else (Html.Attributes.class "") + ) + ] + tile + ) -- cgit v1.2.3-70-g09d2