summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-03-17 00:55:26 +0100 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-03-17 00:55:26 +0100 |
commit | b6fa3b730fe0c4249e714545ca88d2729c815a9b (patch) | |
tree | b14c8e4952a22f8d2943283ca9870a05ccf086e0 /src/map-editor | |
parent | a3c380b2813c9928a2ee600c276295c7803e9e66 (diff) |
...
Diffstat (limited to 'src/map-editor')
-rw-r--r-- | src/map-editor/src/View/SelectableTile.elm | 54 |
1 files changed, 54 insertions, 0 deletions
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 + ) |