From ea51e73fe9e989146789bb5db26b781114a1f1d9 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 14 Jun 2018 13:32:16 +0200 Subject: Still working on those markers... At the moment, Controller Character: - Move: old marker - Attack: old marker - Can't Defend (Move): Diagonal dashes on the old marker - Can't Defend (Attack): Diagonal dashes on the old marker Targeted Character: - Move: half-tile sized pawprint, centered. - Attack: half-tile sized blade, centered. - Can't Defend (Move): ??? - Can't Defend (Attack): ??? Also, clicking on the Targeted Character's markers should still be considered as an input on the tile (or marker) below. --- src/asset/www/svg/marker/blade.svg | 90 +++++++++++++++++++ src/asset/www/svg/marker/pawprint.svg | 118 +++++++++++++++++++++++++ src/asset/www/svg/pawprint.svg | 118 ------------------------- src/battlemap/src/Struct/Tile.elm | 2 +- src/battlemap/src/View/Battlemap/Navigator.elm | 23 +++-- src/battlemap/www/style.css | 28 +++++- 6 files changed, 249 insertions(+), 130 deletions(-) create mode 100644 src/asset/www/svg/marker/blade.svg create mode 100644 src/asset/www/svg/marker/pawprint.svg delete mode 100644 src/asset/www/svg/pawprint.svg diff --git a/src/asset/www/svg/marker/blade.svg b/src/asset/www/svg/marker/blade.svg new file mode 100644 index 0000000..e84734e --- /dev/null +++ b/src/asset/www/svg/marker/blade.svg @@ -0,0 +1,90 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/asset/www/svg/marker/pawprint.svg b/src/asset/www/svg/marker/pawprint.svg new file mode 100644 index 0000000..a391da6 --- /dev/null +++ b/src/asset/www/svg/marker/pawprint.svg @@ -0,0 +1,118 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/src/asset/www/svg/pawprint.svg b/src/asset/www/svg/pawprint.svg deleted file mode 100644 index a391da6..0000000 --- a/src/asset/www/svg/pawprint.svg +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/src/battlemap/src/Struct/Tile.elm b/src/battlemap/src/Struct/Tile.elm index 92abc19..984fc04 100644 --- a/src/battlemap/src/Struct/Tile.elm +++ b/src/battlemap/src/Struct/Tile.elm @@ -50,7 +50,7 @@ get_location tile = tile.location get_icon_id : Type -> String get_icon_id tile = -- Just to see how it looks with SVG - (toString (rem tile.crossing_cost 3)) + (toString (rem tile.crossing_cost 4)) get_cost : Type -> Int get_cost tile = tile.crossing_cost diff --git a/src/battlemap/src/View/Battlemap/Navigator.elm b/src/battlemap/src/View/Battlemap/Navigator.elm index 85a3bea..f5bf209 100644 --- a/src/battlemap/src/View/Battlemap/Navigator.elm +++ b/src/battlemap/src/View/Battlemap/Navigator.elm @@ -64,16 +64,25 @@ marker_get_html is_interactive (loc_ref, marker) = ] ++ ( - if (is_interactive && (marker == Struct.Marker.CanGoTo)) + if (is_interactive) then + if (marker == Struct.Marker.CanGoTo) + then + [ + (Html.Attributes.class "battlemap-navigator-interactive"), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.TileSelected loc_ref) + ) + ] + else + [ + (Html.Attributes.class "battlemap-navigator-interactive") + ] + else [ - (Html.Attributes.class "clickable"), - (Html.Events.onClick - (Struct.Event.TileSelected loc_ref) - ) + (Html.Attributes.class "battlemap-navigator-non-interactive") ] - else - [] ) ) [ diff --git a/src/battlemap/www/style.css b/src/battlemap/www/style.css index 6b802b3..e22d606 100644 --- a/src/battlemap/www/style.css +++ b/src/battlemap/www/style.css @@ -463,6 +463,7 @@ .battlemap-marker-icon {z-index: 2;} .battlemap-path-icon-above-markers {z-index: 3;} .battlemap-character-icon {z-index: 4;} +.battlemap-marker-icon.battlemap-navigator-non-interactive {z-index: 5;} .battlemap-marker-icon, .battlemap-character-icon, @@ -515,7 +516,16 @@ transform: scale(-1, 1); } -.battlemap-marker-icon +.battlemap-marker-icon.battlemap-navigator-non-interactive +{ + box-sizing: border-box; + width: 16px; + height: 16px; + background-size: 100%; + opacity: 0.7; +} + +.battlemap-marker-icon.battlemap-navigator-interactive { box-sizing: border-box; width: 24px; @@ -532,20 +542,20 @@ 0px -1px 2px #333; } -.battlemap-can-go-to-marker +.battlemap-can-go-to-marker.battlemap-navigator-interactive { background-color: #FFF; opacity: 0.3; transition: opacity 0.3s ease-out; } -.battlemap-can-go-to-marker:hover +.battlemap-can-go-to-marker.battlemap-navigator-interactive:hover { background-color: rgba(255, 255, 255, 0.9); opacity: 1; } -.battlemap-can-attack-marker +.battlemap-can-attack-marker.battlemap-navigator-interactive { background-color:rgba(0,0,0,0.7); width: 28px; @@ -556,6 +566,16 @@ border-radius: 0; } +.battlemap-can-attack-marker.battlemap-navigator-non-interactive +{ + background-image: url(/asset/svg/marker/blade.svg); +} + +.battlemap-can-go-to-marker.battlemap-navigator-non-interactive +{ + background-image: url(/asset/svg/marker/pawprint.svg); +} + .battlemap-cant-defend-marker { background: -- cgit v1.2.3-70-g09d2