From 3827717765a0ff4b73c954183b3c5b9ed7145712 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Tue, 10 Apr 2018 18:36:35 +0200 Subject: Puts path below markers when it is locked. Still not happy with the head of the path arrow though. --- src/asset/www/svg/arrows.svg | 40 ++++++++++++++------------ src/battlemap/src/Struct/Navigator.elm | 6 ++-- src/battlemap/src/View/Battlemap/Navigator.elm | 15 ++++++++-- src/battlemap/www/style.css | 7 +++-- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/asset/www/svg/arrows.svg b/src/asset/www/svg/arrows.svg index b9a9386..d4e0bb2 100755 --- a/src/asset/www/svg/arrows.svg +++ b/src/asset/www/svg/arrows.svg @@ -15,8 +15,8 @@ viewBox="0 0 96 32" version="1.1" id="svg8" - inkscape:version="0.92.1 r15371" - sodipodi:docname="arrows_celtic.svg"> + inkscape:version="0.92.2 5c3e80d, 2017-08-06" + sodipodi:docname="arrows.svg"> image/svg+xml - + @@ -109,7 +109,7 @@ id="rect3690" width="56" height="16" - x="3.1789146e-008" + x="3.1789146e-08" y="273" /> + inkscape:transform-center-x="-2.3333332" + transform="matrix(0.57692211,0,0,0.9278828,22.111614,20.74476)" /> + d="m 64,19.5 c 2.927361,-2.927361 1.00115,-8.428511 5,-9.5 3.318077,0.889076 5.252082,3.252082 8,6 -2.744825,2.744825 -4.671289,5.108075 -8,6 -3.99885,-1.071489 -2.072639,-6.572639 -5,-9.5 V 10 c 3.99885,1.071489 2.087078,6.587078 5,9.5 2.314803,0 3.842296,-1.494798 5,-3.5 -1.155443,-2.001287 -2.763488,-4.099272 -5,-3.5 -2.916532,2.916532 -1.00115,8.428511 -5,9.5 z" + id="path4515" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccccccc" /> @@ -209,7 +211,7 @@ y="0" xlink:href="#path4832" id="use4834" - transform="translate(-0.94605928,1.7668127)" + transform="translate(-1.25474,4.6243127)" width="100%" height="100%" /> diff --git a/src/battlemap/src/Struct/Navigator.elm b/src/battlemap/src/Struct/Navigator.elm index 18bf9e3..a0640e0 100644 --- a/src/battlemap/src/Struct/Navigator.elm +++ b/src/battlemap/src/Struct/Navigator.elm @@ -47,7 +47,8 @@ type alias Summary = { starting_location: Struct.Location.Type, path: (List Struct.Direction.Type), - markers: (List (Struct.Location.Ref, Struct.Marker.Type)) + markers: (List (Struct.Location.Ref, Struct.Marker.Type)), + locked_path: Bool } -------------------------------------------------------------------------------- @@ -124,7 +125,8 @@ get_summary navigator = (Dict.toList navigator.range_indicators ) - ) + ), + locked_path = navigator.locked_path } clear_path : Type -> Type diff --git a/src/battlemap/src/View/Battlemap/Navigator.elm b/src/battlemap/src/View/Battlemap/Navigator.elm index 18bcb38..d400659 100644 --- a/src/battlemap/src/View/Battlemap/Navigator.elm +++ b/src/battlemap/src/View/Battlemap/Navigator.elm @@ -81,6 +81,7 @@ marker_get_html is_interactive (loc_ref, marker) = ) path_node_get_html : ( + Bool -> Struct.Direction.Type -> ( Struct.Location.Type, @@ -93,7 +94,7 @@ path_node_get_html : ( (List (Html.Html Struct.Event.Type)) ) ) -path_node_get_html next_dir (curr_loc, curr_dir, curr_nodes) = +path_node_get_html is_below_markers next_dir (curr_loc, curr_dir, curr_nodes) = ( (Struct.Location.neighbor curr_loc next_dir), next_dir, @@ -101,6 +102,15 @@ path_node_get_html next_dir (curr_loc, curr_dir, curr_nodes) = (Html.div [ (Html.Attributes.class "battlemap-path-icon"), + (Html.Attributes.class + ( + if (is_below_markers) + then + "battlemap-path-icon-below-markers" + else + "battlemap-path-icon-above-markers" + ) + ), (Html.Attributes.class "battlemap-tiled"), (Html.Attributes.class ( @@ -154,6 +164,7 @@ mark_the_spot loc origin_dir = (Html.div [ (Html.Attributes.class "battlemap-path-icon"), + (Html.Attributes.class "battlemap-path-icon-above-markers"), (Html.Attributes.class "battlemap-tiled"), (Html.Attributes.class ( @@ -200,7 +211,7 @@ get_html nav_summary is_interactive = let (final_loc, final_dir, path_node_htmls) = (List.foldr - (path_node_get_html) + (path_node_get_html nav_summary.locked_path) (nav_summary.starting_location, Struct.Direction.None, []) nav_summary.path ) diff --git a/src/battlemap/www/style.css b/src/battlemap/www/style.css index a719e51..6d30f80 100644 --- a/src/battlemap/www/style.css +++ b/src/battlemap/www/style.css @@ -206,9 +206,10 @@ .battlemap-tile-variant-8 {background-position: 64px 64px;} .battlemap-tile-icon {z-index: 0; position: absolute; background-size: 96px 96px;} -.battlemap-marker-icon {z-index: 1;} -.battlemap-path-icon {z-index: 2;} -.battlemap-character-icon {z-index: 3;} +.battlemap-path-icon-below-markers {z-index: 1;} +.battlemap-marker-icon {z-index: 2;} +.battlemap-path-icon-above-markers {z-index: 3;} +.battlemap-character-icon {z-index: 4;} .battlemap-marker-icon, .battlemap-character-icon, -- cgit v1.2.3-70-g09d2