aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battlemap/src/View/SubMenu/Timeline.elm')
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline.elm66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/battlemap/src/View/SubMenu/Timeline.elm b/src/battlemap/src/View/SubMenu/Timeline.elm
new file mode 100644
index 0000000..eb67085
--- /dev/null
+++ b/src/battlemap/src/View/SubMenu/Timeline.elm
@@ -0,0 +1,66 @@
+module View.SubMenu.Timeline exposing (get_html)
+
+-- Elm -------------------------------------------------------------------------
+import Array
+
+import Html
+import Html.Attributes
+--import Html.Events
+import Html.Lazy
+
+-- Battlemap -------------------------------------------------------------------
+import Struct.Event
+import Struct.TurnResult
+import Struct.Model
+
+import View.SubMenu.Timeline.Attack
+import View.SubMenu.Timeline.Movement
+import View.SubMenu.Timeline.WeaponSwitch
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_turn_result_html : (
+ Struct.Model.Type ->
+ Struct.TurnResult.Type ->
+ (Html.Html Struct.Event.Type)
+ )
+get_turn_result_html model turn_result =
+ case turn_result of
+ (Struct.TurnResult.Moved movement) ->
+ (View.SubMenu.Timeline.Movement.get_html model movement)
+
+ (Struct.TurnResult.Attacked attack) ->
+ (View.SubMenu.Timeline.Attack.get_html model attack)
+
+ (Struct.TurnResult.SwitchedWeapon weapon_switch) ->
+ (View.SubMenu.Timeline.WeaponSwitch.get_html
+ model
+ weapon_switch
+ )
+
+true_get_html : (
+ Struct.Model.Type ->
+ (Array.Array Struct.TurnResult.Type) ->
+ (Html.Html Struct.Event.Type)
+ )
+true_get_html model turn_results =
+ (Html.div
+ [
+ (Html.Attributes.class "battlemap-tabmenu-content"),
+ (Html.Attributes.class "battlemap-tabmenu-timeline-tab")
+ ]
+ (Array.toList
+ (Array.map
+ (get_turn_result_html model)
+ turn_results
+ )
+ )
+ )
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type)
+get_html model =
+ (Html.Lazy.lazy (true_get_html model) model.timeline)