summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/map-editor/src/View')
-rw-r--r-- | src/map-editor/src/View/Map.elm | 60 | ||||
-rw-r--r-- | src/map-editor/src/View/Map/Tile.elm | 92 | ||||
-rw-r--r-- | src/map-editor/src/View/SubMenu/Status/TileInfo.elm | 8 | ||||
-rw-r--r-- | src/map-editor/src/View/SubMenu/Tiles.elm | 2 |
4 files changed, 73 insertions, 89 deletions
diff --git a/src/map-editor/src/View/Map.elm b/src/map-editor/src/View/Map.elm index b28f5c2..d98c088 100644 --- a/src/map-editor/src/View/Map.elm +++ b/src/map-editor/src/View/Map.elm @@ -9,7 +9,7 @@ import Html.Lazy import List --- Map ------------------------------------------------------------------------- +-- Map Editor ------------------------------------------------------------------ import Constants.UI import Struct.Event @@ -33,32 +33,28 @@ get_tiles_html tb map = [ (Html.Attributes.class "map-tiles-layer"), (Html.Attributes.style - [ - ( - "width", + "width" + ( + (String.fromInt ( - (toString - ( - (Struct.Map.get_width map) - * Constants.UI.tile_size - ) - ) - ++ "px" + (Struct.Map.get_width map) + * Constants.UI.tile_size ) - ), - ( - "height", + ) + ++ "px" + ) + ), + (Html.Attributes.style + "height" + ( + (String.fromInt ( - (toString - ( - (Struct.Map.get_height map) - * Constants.UI.tile_size - ) - ) - ++ "px" + (Struct.Map.get_height map) + * Constants.UI.tile_size ) ) - ] + ++ "px" + ) ) ] (List.map @@ -79,21 +75,17 @@ get_html model = [ (Html.Attributes.class "map-actual"), (Html.Attributes.style + "transform" ( if ((Struct.UI.get_zoom_level model.ui) == 1) - then [] + then "" else - [ - ( - "transform", - ( - "scale(" - ++ - (toString (Struct.UI.get_zoom_level model.ui)) - ++ ")" - ) - ) - ] + ( + "scale(" + ++ + (String.fromFloat (Struct.UI.get_zoom_level model.ui)) + ++ ")" + ) ) ) ] diff --git a/src/map-editor/src/View/Map/Tile.elm b/src/map-editor/src/View/Map/Tile.elm index 32f536c..bf112d1 100644 --- a/src/map-editor/src/View/Map/Tile.elm +++ b/src/map-editor/src/View/Map/Tile.elm @@ -5,7 +5,7 @@ import Html import Html.Attributes import Html.Events --- Battlemap ------------------------------------------------------------------- +-- Map Editor ------------------------------------------------------------------ import Constants.UI import Constants.IO @@ -25,21 +25,19 @@ get_layer_html : ( get_layer_html index border = (Html.div [ - (Html.Attributes.class ("map-tile-icon-f-" ++ (toString index))), + (Html.Attributes.class + ("map-tile-icon-f-" ++ (String.fromInt index)) + ), (Html.Attributes.style - [ - ( - "background-image", - ( - "url(" - ++ Constants.IO.tile_assets_url - ++ (Struct.Tile.get_border_type_id border) - ++ "-f-" - ++ (Struct.Tile.get_border_variant_id border) - ++ ".svg)" - ) - ) - ] + "background-image" + ( + "url(" + ++ Constants.IO.tile_assets_url + ++ (Struct.Tile.get_border_type_id border) + ++ "-f-" + ++ (Struct.Tile.get_border_variant_id border) + ++ ".svg)" + ) ) ] [] @@ -55,17 +53,13 @@ get_content_html tile = [ (Html.Attributes.class "map-tile-icon-bg"), (Html.Attributes.style - [ - ( - "background-image", - ( - "url(" - ++ Constants.IO.tile_assets_url - ++ (Struct.Tile.get_type_id tile) - ++ "-bg.svg)" - ) - ) - ] + "background-image" + ( + "url(" + ++ Constants.IO.tile_assets_url + ++ (Struct.Tile.get_type_id tile) + ++ "-bg.svg)" + ) ) ] [] @@ -76,19 +70,15 @@ get_content_html tile = [ (Html.Attributes.class "map-tile-icon-dt"), (Html.Attributes.style - [ - ( - "background-image", - ( - "url(" - ++ Constants.IO.tile_assets_url - ++ (Struct.Tile.get_type_id tile) - ++ "-v-" - ++ (Struct.Tile.get_variant_id tile) - ++ ".svg)" - ) - ) - ] + "background-image" + ( + "url(" + ++ Constants.IO.tile_assets_url + ++ (Struct.Tile.get_type_id tile) + ++ "-v-" + ++ (Struct.Tile.get_variant_id tile) + ++ ".svg)" + ) ) ] [] @@ -127,7 +117,7 @@ get_html tb tile = (Html.Attributes.class ( "map-tile-variant-" - ++ (toString (Struct.Tile.get_local_variant_ix tile)) + ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile)) ) ), (Html.Attributes.class "clickable"), @@ -135,16 +125,18 @@ get_html tb tile = (Struct.Event.TileSelected (Struct.Location.get_ref tile_loc)) ), (Html.Attributes.style - [ - ( - "top", - ((toString (tile_loc.y * Constants.UI.tile_size)) ++ "px") - ), - ( - "left", - ((toString (tile_loc.x * Constants.UI.tile_size)) ++ "px") - ) - ] + "top" + ( + (String.fromInt (tile_loc.y * Constants.UI.tile_size)) + ++ "px" + ) + ), + (Html.Attributes.style + "left" + ( + (String.fromInt (tile_loc.x * Constants.UI.tile_size)) + ++ "px" + ) ) ] (get_content_html tile) diff --git a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm b/src/map-editor/src/View/SubMenu/Status/TileInfo.elm index 91c4b48..450e52d 100644 --- a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm +++ b/src/map-editor/src/View/SubMenu/Status/TileInfo.elm @@ -30,7 +30,7 @@ get_icon tile = (Html.Attributes.class ( "map-tile-variant-" - ++ (toString (Struct.Tile.get_local_variant_ix tile)) + ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile)) ) ) ] @@ -64,7 +64,7 @@ get_cost tile = then "Obstructed" else - ("Cost: " ++ (toString cost)) + ("Cost: " ++ (String.fromInt cost)) in (Html.div [ @@ -88,9 +88,9 @@ get_location tile = (Html.text ( "{x: " - ++ (toString tile_location.x) + ++ (String.fromInt tile_location.x) ++ "; y: " - ++ (toString tile_location.y) + ++ (String.fromInt tile_location.y) ++ "}" ) ) diff --git a/src/map-editor/src/View/SubMenu/Tiles.elm b/src/map-editor/src/View/SubMenu/Tiles.elm index 591b312..d2c4c5b 100644 --- a/src/map-editor/src/View/SubMenu/Tiles.elm +++ b/src/map-editor/src/View/SubMenu/Tiles.elm @@ -16,7 +16,7 @@ import View.Map.Tile -------------------------------------------------------------------------------- get_icon_html : Int -> (Html.Html Struct.Event.Type) get_icon_html index = - let tile_id = (toString index) in + let tile_id = (String.fromInt index) in (Html.div [ (Html.Attributes.class "map-tile"), |