summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-22 13:46:32 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-22 13:46:32 +0200 |
commit | 2d20dc042a386bc9f66bc5f535403227f9acf1b1 (patch) | |
tree | 49e529ff4e12841d160627d9853c088ba0dd637b /client/elm/battlemap/src/View.elm | |
parent | 0d5fba42a1597e5a43266c071776e7acf58071e2 (diff) |
No more import ... exposing.
It got too confusing.
Diffstat (limited to 'client/elm/battlemap/src/View.elm')
-rw-r--r-- | client/elm/battlemap/src/View.elm | 76 |
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) -> ( |