summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-03-22 19:02:58 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-03-22 19:02:58 +0100 |
commit | caf0e9497229abb56a7428e60b19ee3d05fa7e9c (patch) | |
tree | 21272443e733fb9396947f969e01cfe85e6481bd /src/shared/battle-characters/BattleCharacters/View/Portrait.elm | |
parent | 397e54affd6d434ea5d055f34cbac637867cde0a (diff) |
[Broken] More factoring in progress...
Diffstat (limited to 'src/shared/battle-characters/BattleCharacters/View/Portrait.elm')
-rw-r--r-- | src/shared/battle-characters/BattleCharacters/View/Portrait.elm | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/shared/battle-characters/BattleCharacters/View/Portrait.elm b/src/shared/battle-characters/BattleCharacters/View/Portrait.elm new file mode 100644 index 0000000..50c5c4c --- /dev/null +++ b/src/shared/battle-characters/BattleCharacters/View/Portrait.elm @@ -0,0 +1,99 @@ +module BattleCharacters.View.Portrait exposing + ( + get_html + ) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes +import Html.Events + +-- Shared ---------------------------------------------------------------------- +import Util.Html + +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Armor +import BattleCharacters.Struct.Equipment +import BattleCharacters.Struct.Portrait + +-- Local Module ---------------------------------------------------------------- +import Struct.Event + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_portrait_body_html : ( + BattleCharacters.Struct.Equipment.Type -> + (Html.Html Struct.Event.Type) + ) +get_portrait_body_html equipment = + (Html.div + [ + (Html.Attributes.class "character-portrait-body"), + (Html.Attributes.class + ( + "asset-character-portrait-" + ++ + (BattleCharacters.Struct.Portrait.get_id + (BattleCharacters.Struct.Equipment.get_portrait equipment) + ) + ) + ) + ] + [ + ] + ) + +get_portrait_armor_html : ( + BattleCharacters.Struct.Equipment.Type -> + (Html.Html Struct.Event.Type) + ) +get_portrait_armor_html equipment = + (Html.div + [ + (Html.Attributes.class "character-portrait-armor"), + (Html.Attributes.class + ( + "asset-armor-" + ++ + (BattleCharacters.Struct.Armor.get_image_id + (BattleCharacters.Equipment.get_armor equipment) + ) + ) + ), + (Html.Attributes.class + ( + "asset-armor-variation-" + ++ + (BattleCharacters.Struct.Portrait.get_body_id + (BattleCharacters.Struct.Equipment.get_portrait equipment) + ) + ) + ) + ] + [ + ] + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : ( + (List (Html.Attribute Struct.Event.Type)) -> + BattleCharacters.Equipment.Type -> + (Html.Html Struct.Event.Type) + ) +get_html extra_attributes equipment = + (Html.div + ( + [ + (Html.Attributes.class "character-portrait") + ] + ++ + extra_attributes + ) + [ + (get_portrait_body_html equipment), + (get_portrait_armor_html equipment) + ] + ) |