aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battlemap/src/View/Controlled/ManualControls.elm')
-rw-r--r--src/battlemap/src/View/Controlled/ManualControls.elm45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/battlemap/src/View/Controlled/ManualControls.elm b/src/battlemap/src/View/Controlled/ManualControls.elm
new file mode 100644
index 0000000..8d37333
--- /dev/null
+++ b/src/battlemap/src/View/Controlled/ManualControls.elm
@@ -0,0 +1,45 @@
+module View.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")
+ ]
+ )