aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'elm/battlemap/src/View')
-rw-r--r--elm/battlemap/src/View/Controls.elm4
-rw-r--r--elm/battlemap/src/View/Status.elm17
2 files changed, 14 insertions, 7 deletions
diff --git a/elm/battlemap/src/View/Controls.elm b/elm/battlemap/src/View/Controls.elm
index be698bf..f5851a9 100644
--- a/elm/battlemap/src/View/Controls.elm
+++ b/elm/battlemap/src/View/Controls.elm
@@ -12,7 +12,7 @@ direction_button dir label =
(Html.button
[
(Html.Events.onClick
- (Event.DirectionRequest dir)
+ (Event.DirectionRequested dir)
)
]
[ (Html.text label) ]
@@ -21,7 +21,7 @@ direction_button dir label =
end_turn_button : (Html.Html Event.Type)
end_turn_button =
(Html.button
- [ (Html.Events.onClick Event.EndTurn) ]
+ [ (Html.Events.onClick Event.TurnEnded) ]
[ (Html.text "End Turn") ]
)
diff --git a/elm/battlemap/src/View/Status.elm b/elm/battlemap/src/View/Status.elm
index 5fcc663..de2a167 100644
--- a/elm/battlemap/src/View/Status.elm
+++ b/elm/battlemap/src/View/Status.elm
@@ -4,6 +4,9 @@ import Dict
import Html
+import Battlemap
+import Character
+
import Error
import Event
import Model
@@ -11,20 +14,24 @@ import Model
moving_character_text : Model.Type -> String
moving_character_text model =
case model.selection of
- Nothing -> "Error: no model.selection."
- (Just selection) ->
- case (Dict.get selection.character model.characters) of
+ (Model.SelectedCharacter char_id) ->
+ case (Dict.get char_id model.characters) of
Nothing -> "Error: Unknown character selected."
(Just char) ->
(
"Controlling "
++ char.name
++ ": "
- ++ (toString selection.navigator.remaining_points)
+ ++ (toString
+ (Battlemap.get_navigator_remaining_points
+ model.battlemap
+ )
+ )
++ "/"
- ++ (toString char.movement_points)
+ ++ (toString (Character.get_movement_points char))
++ " movement points remaining."
)
+ _ -> "Error: model.selection does not match its state."
view : Model.Type -> (Html.Html Event.Type)
view model =