summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battlemap/src/View/SubMenu/ManualControls.elm')
-rw-r--r-- | src/battlemap/src/View/SubMenu/ManualControls.elm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/battlemap/src/View/SubMenu/ManualControls.elm b/src/battlemap/src/View/SubMenu/ManualControls.elm new file mode 100644 index 0000000..f2e900c --- /dev/null +++ b/src/battlemap/src/View/SubMenu/ManualControls.elm @@ -0,0 +1,45 @@ +module View.SideBar.ManualControls exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes +import Html.Events + +-- Battlemap ------------------------------------------------------------------- +import Struct.Direction +import Struct.Event + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +direction_button : ( + Struct.Direction.Type -> + String -> + (Html.Html Struct.Event.Type) + ) +direction_button dir label = + (Html.button + [ + (Html.Events.onClick + (Struct.Event.DirectionRequested dir) + ) + ] + [ (Html.text label) ] + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : (Html.Html Struct.Event.Type) +get_html = + (Html.div + [ + (Html.Attributes.class "battlemap-manual-controls") + ] + [ + (direction_button Struct.Direction.Left "Left"), + (direction_button Struct.Direction.Down "Down"), + (direction_button Struct.Direction.Up "Up"), + (direction_button Struct.Direction.Right "Right") + ] + ) |