summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-06-22 14:16:12 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-06-22 14:16:12 +0200
commitcbfcab80b9faf43a2f75cda431dff53842cf93dd (patch)
treec0d9cd2800fccfd34a00f3e2006dcf9ed0a1fe8f
parent0f041f72c3d7c116eeb307d339f934d801c5b43a (diff)
Fixes markers preventing char selection.
Dead characters do not appear on the map, even during the animation showing the actions leading to their demise.
-rw-r--r--src/battlemap/src/ElmModule/Update.elm4
-rw-r--r--src/battlemap/src/Struct/Event.elm1
-rw-r--r--src/battlemap/src/Util/Array.elm11
-rw-r--r--src/battlemap/src/View/Battlemap/Navigator.elm12
-rw-r--r--src/battlemap/src/View/MessageBoard.elm1
-rw-r--r--src/battlemap/src/View/MessageBoard/Animator.elm1
-rw-r--r--src/battlemap/www/style.css2
7 files changed, 24 insertions, 8 deletions
diff --git a/src/battlemap/src/ElmModule/Update.elm b/src/battlemap/src/ElmModule/Update.elm
index fda47f6..0e4f4a6 100644
--- a/src/battlemap/src/ElmModule/Update.elm
+++ b/src/battlemap/src/ElmModule/Update.elm
@@ -16,6 +16,7 @@ import Update.HandleServerReply
import Update.LookForCharacter
import Update.RequestDirection
import Update.SelectCharacter
+import Update.SelectCharacterOrTile
import Update.SelectTab
import Update.SelectTile
import Update.SendLoadBattlemapRequest
@@ -61,6 +62,9 @@ update event model =
(Struct.Event.TileSelected loc) ->
(Update.SelectTile.apply_to new_model loc)
+ (Struct.Event.CharacterOrTileSelected loc) ->
+ (Update.SelectCharacterOrTile.apply_to new_model loc)
+
(Struct.Event.CharacterSelected char_id) ->
(Update.SelectCharacter.apply_to new_model char_id)
diff --git a/src/battlemap/src/Struct/Event.elm b/src/battlemap/src/Struct/Event.elm
index 8355d52..891cc60 100644
--- a/src/battlemap/src/Struct/Event.elm
+++ b/src/battlemap/src/Struct/Event.elm
@@ -30,6 +30,7 @@ type Type =
| ServerReplied (Result Http.Error (List Struct.ServerReply.Type))
| TabSelected Struct.UI.Tab
| TileSelected Struct.Location.Ref
+ | CharacterOrTileSelected Struct.Location.Ref
| TurnEnded
| WeaponSwitchRequest
diff --git a/src/battlemap/src/Util/Array.elm b/src/battlemap/src/Util/Array.elm
index 69d329c..9e57c18 100644
--- a/src/battlemap/src/Util/Array.elm
+++ b/src/battlemap/src/Util/Array.elm
@@ -1,4 +1,9 @@
-module Util.Array exposing (update, update_unsafe)
+module Util.Array exposing
+ (
+ update,
+ update_unsafe,
+ filter_first
+ )
import Array
@@ -23,3 +28,7 @@ update_unsafe index fun array =
case (Array.get index array) of
Nothing -> array
(Just e) -> (Array.set index (fun e) array)
+
+filter_first : (t -> Bool) -> (Array.Array t) -> (Maybe t)
+filter_first fun array =
+ (Array.get 0 (Array.filter fun array))
diff --git a/src/battlemap/src/View/Battlemap/Navigator.elm b/src/battlemap/src/View/Battlemap/Navigator.elm
index b22b95e..a03e7d0 100644
--- a/src/battlemap/src/View/Battlemap/Navigator.elm
+++ b/src/battlemap/src/View/Battlemap/Navigator.elm
@@ -81,7 +81,9 @@ marker_get_html is_interactive (loc_ref, marker) =
[
(Html.Attributes.class "battlemap-navigator-interactive"),
(Html.Attributes.class "clickable"),
- (Html.Events.onClick (Struct.Event.TileSelected loc_ref))
+ (Html.Events.onClick
+ (Struct.Event.CharacterOrTileSelected loc_ref)
+ )
]
else
[
@@ -90,7 +92,9 @@ marker_get_html is_interactive (loc_ref, marker) =
else
[
(Html.Attributes.class "battlemap-navigator-non-interactive"),
- (Html.Events.onClick (Struct.Event.TileSelected loc_ref))
+ (Html.Events.onClick
+ (Struct.Event.CharacterOrTileSelected loc_ref)
+ )
]
)
)
@@ -140,7 +144,7 @@ path_node_get_html is_below_markers next_dir (curr_loc, curr_dir, curr_nodes) =
)
),
(Html.Events.onClick
- (Struct.Event.TileSelected
+ (Struct.Event.CharacterOrTileSelected
(Struct.Location.get_ref curr_loc)
)
),
@@ -192,7 +196,7 @@ mark_the_spot loc origin_dir =
)
),
(Html.Events.onClick
- (Struct.Event.TileSelected (Struct.Location.get_ref loc))
+ (Struct.Event.CharacterOrTileSelected (Struct.Location.get_ref loc))
),
(Html.Attributes.style
[
diff --git a/src/battlemap/src/View/MessageBoard.elm b/src/battlemap/src/View/MessageBoard.elm
index 308a534..5de6e8d 100644
--- a/src/battlemap/src/View/MessageBoard.elm
+++ b/src/battlemap/src/View/MessageBoard.elm
@@ -2,7 +2,6 @@ module View.MessageBoard exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
-import Html.Attributes
-- Struct.Battlemap -------------------------------------------------------------------
import Struct.Event
diff --git a/src/battlemap/src/View/MessageBoard/Animator.elm b/src/battlemap/src/View/MessageBoard/Animator.elm
index 7899d4f..5c8938b 100644
--- a/src/battlemap/src/View/MessageBoard/Animator.elm
+++ b/src/battlemap/src/View/MessageBoard/Animator.elm
@@ -2,7 +2,6 @@ module View.MessageBoard.Animator exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
-import Html.Attributes
-- Battlemap -------------------------------------------------------------------
import Struct.Event
diff --git a/src/battlemap/www/style.css b/src/battlemap/www/style.css
index 09e1edd..532ab88 100644
--- a/src/battlemap/www/style.css
+++ b/src/battlemap/www/style.css
@@ -47,7 +47,7 @@
display: flex;
flex-flow: row;
- justify-content: space-between;
+ justify-content: space-evenly;
}