blob: eb67085bb84f90634a822a6fdc6fb1758a4bd925 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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)
|