summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battlemap/src/View/SubMenu')
-rw-r--r-- | src/battlemap/src/View/SubMenu/Characters.elm | 33 | ||||
-rw-r--r-- | src/battlemap/src/View/SubMenu/Timeline/Attack.elm | 35 | ||||
-rw-r--r-- | src/battlemap/src/View/SubMenu/Timeline/Movement.elm | 32 | ||||
-rw-r--r-- | src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm | 32 |
4 files changed, 13 insertions, 119 deletions
diff --git a/src/battlemap/src/View/SubMenu/Characters.elm b/src/battlemap/src/View/SubMenu/Characters.elm index a34cf4a..d96eb2d 100644 --- a/src/battlemap/src/View/SubMenu/Characters.elm +++ b/src/battlemap/src/View/SubMenu/Characters.elm @@ -12,38 +12,11 @@ import Struct.Character import Struct.Event import Struct.Model +import View.Character + -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -get_character_portrait_html : ( - String -> - Struct.Character.Type -> - (Html.Html Struct.Event.Type) - ) -get_character_portrait_html viewer_id char = - (Html.div - [ - (Html.Attributes.class - ( - "asset-character-portrait-" - ++ (Struct.Character.get_portrait_id char) - ) - ), - (Html.Attributes.class - ( - if ((Struct.Character.get_player_id char) == viewer_id) - then - "battlemap-character-ally" - else - "battlemap-character-enemy" - ) - ), - (Html.Attributes.class "battlemap-character-portrait") - ] - [ - ] - ) - get_character_element_html : ( String -> Struct.Character.Type -> @@ -61,7 +34,7 @@ get_character_element_html viewer_id char = ) ] [ - (get_character_portrait_html viewer_id char), + (View.Character.get_portrait_html viewer_id char), (Html.text ( (Struct.Character.get_name char) diff --git a/src/battlemap/src/View/SubMenu/Timeline/Attack.elm b/src/battlemap/src/View/SubMenu/Timeline/Attack.elm index 6dab423..3330007 100644 --- a/src/battlemap/src/View/SubMenu/Timeline/Attack.elm +++ b/src/battlemap/src/View/SubMenu/Timeline/Attack.elm @@ -14,6 +14,8 @@ import Struct.TurnResult import Struct.Character import Struct.Model +import View.Character + -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -39,35 +41,6 @@ get_title_html attacker defender = ] ) -get_portrait_html : ( - String -> - Struct.Character.Type -> - (Html.Html Struct.Event.Type) - ) -get_portrait_html viewer_id char = - (Html.div - [ - (Html.Attributes.class "battlemap-timeline-portrait"), - (Html.Attributes.class - ( - if ((Struct.Character.get_player_id char) == viewer_id) - then - "battlemap-character-ally" - else - "battlemap-character-enemy" - ) - ), - (Html.Attributes.class - ( - "asset-character-portrait-" - ++ (Struct.Character.get_portrait_id char) - ) - ) - ] - [ - ] - ) - get_effect_text : Struct.Attack.Type -> String get_effect_text attack = ( @@ -167,8 +140,8 @@ get_html model attack = ] ( [ - (get_portrait_html model.player_id atkchar), - (get_portrait_html model.player_id defchar), + (View.Character.get_portrait_html model.player_id atkchar), + (View.Character.get_portrait_html model.player_id defchar), (get_title_html atkchar defchar) ] ++ diff --git a/src/battlemap/src/View/SubMenu/Timeline/Movement.elm b/src/battlemap/src/View/SubMenu/Timeline/Movement.elm index f561d6c..bba9bc1 100644 --- a/src/battlemap/src/View/SubMenu/Timeline/Movement.elm +++ b/src/battlemap/src/View/SubMenu/Timeline/Movement.elm @@ -13,37 +13,11 @@ import Struct.TurnResult import Struct.Character import Struct.Model +import View.Character + -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -get_portrait_html : ( - String -> - Struct.Character.Type -> - (Html.Html Struct.Event.Type) - ) -get_portrait_html viewer_id char = - (Html.div - [ - (Html.Attributes.class "battlemap-timeline-portrait"), - (Html.Attributes.class - ( - if ((Struct.Character.get_player_id char) == viewer_id) - then - "battlemap-character-ally" - else - "battlemap-character-enemy" - ) - ), - (Html.Attributes.class - ( - "asset-character-portrait-" - ++ (Struct.Character.get_portrait_id char) - ) - ) - ] - [ - ] - ) -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- @@ -62,7 +36,7 @@ get_html model movement = (Html.Attributes.class "battlemap-timeline-movement") ] [ - (get_portrait_html model.player_id char), + (View.Character.get_portrait_html model.player_id char), (Html.text ( (Struct.Character.get_name char) diff --git a/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm b/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm index 91191c4..53122ad 100644 --- a/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm +++ b/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm @@ -13,37 +13,11 @@ import Struct.TurnResult import Struct.Character import Struct.Model +import View.Character + -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -get_portrait_html : ( - String -> - Struct.Character.Type -> - (Html.Html Struct.Event.Type) - ) -get_portrait_html viewer_id char = - (Html.div - [ - (Html.Attributes.class "battlemap-timeline-portrait"), - (Html.Attributes.class - ( - if ((Struct.Character.get_player_id char) == viewer_id) - then - "battlemap-character-ally" - else - "battlemap-character-enemy" - ) - ), - (Html.Attributes.class - ( - "asset-character-portrait-" - ++ (Struct.Character.get_portrait_id char) - ) - ) - ] - [ - ] - ) -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- @@ -62,7 +36,7 @@ get_html model weapon_switch = (Html.Attributes.class "battlemap-timeline-weapon-switch") ] [ - (get_portrait_html model.player_id char), + (View.Character.get_portrait_html model.player_id char), (Html.text ( (Struct.Character.get_name char) |