summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'client/elm/battlemap/src/View.elm')
-rw-r--r--client/elm/battlemap/src/View.elm76
1 files changed, 47 insertions, 29 deletions
diff --git a/client/elm/battlemap/src/View.elm b/client/elm/battlemap/src/View.elm
index 50fa563..2ea5972 100644
--- a/client/elm/battlemap/src/View.elm
+++ b/client/elm/battlemap/src/View.elm
@@ -1,55 +1,73 @@
module View exposing (view)
-import Html exposing (Html, button, div, text)
-import Html.Events exposing (onClick)
+import Dict
-import Update exposing (Msg(..))
-import Model exposing (Model)
+import Html
+import Html.Events
+
+import Battlemap.Direction
+import Battlemap.Html
+
+import Update
+import Model
-import Battlemap.Html as Batmap exposing (view)
-import Battlemap.Direction exposing (Direction(..))
-import Dict as Dt exposing (get)
-- VIEW
-view : Model -> (Html Msg)
+view : Model.Type -> (Html.Html Update.Type)
view model =
- (div
+ (Html.div
[]
[
- (button
- [ (onClick (DirectionRequest Left)) ]
- [ (text "Left") ]
+ (Html.button
+ [
+ (Html.Events.onClick
+ (Update.DirectionRequest Battlemap.Direction.Left)
+ )
+ ]
+ [ (Html.text "Left") ]
),
- (button
- [ (onClick (DirectionRequest Down)) ]
- [ (text "Down") ]
+ (Html.button
+ [
+ (Html.Events.onClick
+ (Update.DirectionRequest Battlemap.Direction.Down)
+ )
+ ]
+ [ (Html.text "Down") ]
),
- (button
- [ (onClick (DirectionRequest Up)) ]
- [ (text "Up") ]
+ (Html.button
+ [
+ (Html.Events.onClick
+ (Update.DirectionRequest Battlemap.Direction.Up)
+ )
+ ]
+ [ (Html.text "Up") ]
),
- (button
- [ (onClick (DirectionRequest Right)) ]
- [ (text "Right") ]
+ (Html.button
+ [
+ (Html.Events.onClick
+ (Update.DirectionRequest Battlemap.Direction.Right)
+ )
+ ]
+ [ (Html.text "Right") ]
),
- (button
- [ (onClick EndTurn) ]
- [ (text "Apply") ]
+ (Html.button
+ [ (Html.Events.onClick Update.EndTurn) ]
+ [ (Html.text "Apply") ]
),
- (div
+ (Html.div
[]
- [(Batmap.view model)]
+ [(Battlemap.Html.view model)]
),
- (div
+ (Html.div
[]
[
- (text
+ (Html.text
(case (model.selection, model.navigator) of
(Nothing, _) -> ""
(_, Nothing) -> ""
((Just char_id), (Just nav)) ->
- case (Dt.get char_id model.characters) of
+ case (Dict.get char_id model.characters) of
Nothing -> ""
(Just char) ->
(