| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-02-02 16:12:59 +0100 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-02-02 16:12:59 +0100 | 
| commit | 99e154714d650de96a87801c366b1070df55c482 (patch) | |
| tree | 933344398529e4583e7b3d2b753ef26c3dff73f4 /src/roster-editor | |
| parent | 2c9511b356e065d34cc51a27e64cd60f542321de (diff) | |
Prints the icons correctly.
Diffstat (limited to 'src/roster-editor')
| -rw-r--r-- | src/roster-editor/src/View/ArmorSelection.elm | 11 | ||||
| -rw-r--r-- | src/roster-editor/src/View/CharacterCard.elm | 36 | ||||
| -rw-r--r-- | src/roster-editor/src/View/GlyphBoardSelection.elm | 15 | ||||
| -rw-r--r-- | src/roster-editor/src/View/GlyphSelection.elm | 13 | ||||
| -rw-r--r-- | src/roster-editor/src/View/Omnimods.elm | 113 | ||||
| -rw-r--r-- | src/roster-editor/src/View/WeaponSelection.elm | 11 | 
6 files changed, 136 insertions, 63 deletions
| diff --git a/src/roster-editor/src/View/ArmorSelection.elm b/src/roster-editor/src/View/ArmorSelection.elm index 5ea8c98..7566405 100644 --- a/src/roster-editor/src/View/ArmorSelection.elm +++ b/src/roster-editor/src/View/ArmorSelection.elm @@ -13,6 +13,7 @@ import Struct.Event  import Struct.Model  import Struct.Omnimods +import View.Omnimods  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- @@ -54,15 +55,7 @@ get_armor_html armor =                 (Html.text (Struct.Armor.get_name armor))              ]           ), -         (Html.div -            [ -               (Html.Attributes.class "info-card-omnimods-listing") -            ] -            (List.map -               (get_mod_html) -               (Struct.Omnimods.get_all_mods (Struct.Armor.get_omnimods armor)) -            ) -         ) +         (View.Omnimods.get_html 1.0 (Struct.Armor.get_omnimods armor))        ]     ) diff --git a/src/roster-editor/src/View/CharacterCard.elm b/src/roster-editor/src/View/CharacterCard.elm index 01aea47..08eaa81 100644 --- a/src/roster-editor/src/View/CharacterCard.elm +++ b/src/roster-editor/src/View/CharacterCard.elm @@ -25,6 +25,7 @@ import Struct.WeaponSet  import View.Character  import View.Gauge +import View.Omnimods  --------------------------------------------------------------------------------  -- LOCAL ----------------------------------------------------------------------- @@ -228,12 +229,11 @@ get_multiplied_mod_html multiplier mod =        )  get_weapon_details : ( -      Struct.Omnimods.Type ->        Float ->        Struct.Weapon.Type ->        (Html.Html Struct.Event.Type)     ) -get_weapon_details omnimods damage_multiplier weapon = +get_weapon_details damage_multiplier weapon =     (Html.div        [           (Html.Attributes.class "character-card-weapon"), @@ -242,14 +242,9 @@ get_weapon_details omnimods damage_multiplier weapon =       ]        [           (get_weapon_field_header damage_multiplier weapon), -         (Html.div -            [ -               (Html.Attributes.class "info-card-omnimods-listing") -            ] -            (List.map -               (get_multiplied_mod_html damage_multiplier) -               (Struct.Omnimods.get_attack_mods omnimods) -            ) +         (View.Omnimods.get_html +            damage_multiplier +            (Struct.Weapon.get_omnimods weapon)           )        ]     ) @@ -272,11 +267,10 @@ get_weapon_summary damage_multiplier weapon =     )  get_armor_details : ( -      Struct.Omnimods.Type ->        Struct.Armor.Type ->        (Html.Html Struct.Event.Type)     ) -get_armor_details omnimods armor = +get_armor_details armor =     (Html.div        [           (Html.Attributes.class "character-card-armor"), @@ -294,15 +288,7 @@ get_armor_details omnimods armor =                 (Html.text (Struct.Armor.get_name armor))              ]           ), -         (Html.div -            [ -               (Html.Attributes.class "info-card-omnimods-listing") -            ] -            (List.map -               (get_mod_html) -               (Struct.Omnimods.get_defense_mods omnimods) -            ) -         ) +         (View.Omnimods.get_html 1.0 (Struct.Armor.get_omnimods armor))        ]     ) @@ -327,7 +313,8 @@ get_glyph_board_details board =              [                 (Html.text (Struct.GlyphBoard.get_name board))              ] -         ) +         ), +         (View.Omnimods.get_html 1.0 (Struct.GlyphBoard.get_omnimods board))        ]     ) @@ -472,7 +459,6 @@ get_full_html char =        damage_modifier = (Struct.Statistics.get_damage_modifier char_statistics)        secondary_weapon = (Struct.WeaponSet.get_secondary_weapon weapon_set)        armor = (Struct.Character.get_armor char) -      omnimods = (Struct.Character.get_current_omnimods char)     in        (Html.div           [ @@ -506,8 +492,8 @@ get_full_html char =                    (get_statuses char)                 ]              ), -            (get_weapon_details omnimods damage_modifier main_weapon), -            (get_armor_details omnimods armor), +            (get_weapon_details damage_modifier main_weapon), +            (get_armor_details armor),              (get_glyph_board_details (Struct.Character.get_glyph_board char)),              (get_relevant_stats char_statistics),              (get_attributes (Struct.Character.get_attributes char)), diff --git a/src/roster-editor/src/View/GlyphBoardSelection.elm b/src/roster-editor/src/View/GlyphBoardSelection.elm index bec3492..c2b7999 100644 --- a/src/roster-editor/src/View/GlyphBoardSelection.elm +++ b/src/roster-editor/src/View/GlyphBoardSelection.elm @@ -13,6 +13,8 @@ import Struct.Event  import Struct.Model  import Struct.Omnimods +import View.Omnimods +  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- @@ -53,16 +55,9 @@ get_glyph_board_html glyph_board =                 (Html.text (Struct.GlyphBoard.get_name glyph_board))              ]           ), -         (Html.div -            [ -               (Html.Attributes.class "info-card-omnimods-listing") -            ] -            (List.map -               (get_mod_html) -               (Struct.Omnimods.get_all_mods -                  (Struct.GlyphBoard.get_omnimods glyph_board) -               ) -            ) +         (View.Omnimods.get_html +            1.0 +            (Struct.GlyphBoard.get_omnimods glyph_board)           )        ]     ) diff --git a/src/roster-editor/src/View/GlyphSelection.elm b/src/roster-editor/src/View/GlyphSelection.elm index 22a5ff6..6158cac 100644 --- a/src/roster-editor/src/View/GlyphSelection.elm +++ b/src/roster-editor/src/View/GlyphSelection.elm @@ -13,6 +13,8 @@ import Struct.Glyph  import Struct.Omnimods  import Struct.Model +import View.Omnimods +  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- @@ -46,16 +48,7 @@ get_glyph_html glyph  =        ]        [           (Html.text (Struct.Glyph.get_name glyph)), -         (Html.div -            [ -            ] -            (List.map -               (get_mod_html) -               (Struct.Omnimods.get_all_mods -                  (Struct.Glyph.get_omnimods glyph) -               ) -            ) -         ) +         (View.Omnimods.get_html 1.0 (Struct.Glyph.get_omnimods glyph))        ]     ) diff --git a/src/roster-editor/src/View/Omnimods.elm b/src/roster-editor/src/View/Omnimods.elm new file mode 100644 index 0000000..f5d3c86 --- /dev/null +++ b/src/roster-editor/src/View/Omnimods.elm @@ -0,0 +1,113 @@ +module View.Omnimods exposing +   ( +      get_html +   ) + +-- Elm ------------------------------------------------------------------------- +import List + +import Html +import Html.Attributes +import Html.Events + +-- Roster Editor --------------------------------------------------------------- +import Struct.Event +import Struct.Omnimods + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_mod_html : (String, Int) -> (Html.Html Struct.Event.Type) +get_mod_html mod = +   let +      (category, value) = mod +   in +      (Html.div +         [ +            (Html.Attributes.class "info-card-mod") +         ] +         [ +            (Html.div +               [ +                  (Html.Attributes.class "omnimod-icon"), +                  (Html.Attributes.class ("omnimod-icon-" ++ category)) +               ] +               [ +               ] +            ), +            (Html.text (String.fromInt value)) +         ] +      ) + +get_multiplied_mod_html : Float -> (String, Int) -> (Html.Html Struct.Event.Type) +get_multiplied_mod_html multiplier mod = +   let +      (category, value) = mod +   in +      (Html.div +         [ +            (Html.Attributes.class "character-card-mod") +         ] +         [ +            (Html.div +               [ +                  (Html.Attributes.class "omnimod-icon"), +                  (Html.Attributes.class ("omnimod-icon-" ++ category)) +               ] +               [ +               ] +            ), +            (Html.text +               (String.fromInt (ceiling ((toFloat value) * multiplier))) +            ) +         ] +      ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : Float -> Struct.Omnimods.Type -> (Html.Html Struct.Event.Type) +get_html attack_multiplier omnimods = +   (Html.div +      [ +         (Html.Attributes.class "omnimod-listing") +      ] +      [ +         (Html.div +            [ +               (Html.Attributes.class "omnimod-attack-mods") +            ] +            (List.map +               (get_multiplied_mod_html attack_multiplier) +               (Struct.Omnimods.get_attack_mods omnimods) +            ) +         ), +         (Html.div +            [ +               (Html.Attributes.class "omnimod-defense-mods") +            ] +            (List.map +               (get_mod_html) +               (Struct.Omnimods.get_defense_mods omnimods) +            ) +         ), +         (Html.div +            [ +               (Html.Attributes.class "omnimod-attribute-mods") +            ] +            (List.map +               (get_mod_html) +               (Struct.Omnimods.get_attributes_mods omnimods) +            ) +         ), +         (Html.div +            [ +               (Html.Attributes.class "omnimod-statistics-mods") +            ] +            (List.map +               (get_mod_html) +               (Struct.Omnimods.get_statistics_mods omnimods) +            ) +         ) +      ] +   ) diff --git a/src/roster-editor/src/View/WeaponSelection.elm b/src/roster-editor/src/View/WeaponSelection.elm index d43a8d9..46b871d 100644 --- a/src/roster-editor/src/View/WeaponSelection.elm +++ b/src/roster-editor/src/View/WeaponSelection.elm @@ -13,6 +13,7 @@ import Struct.Model  import Struct.Weapon  import Struct.Omnimods +import View.Omnimods  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- @@ -97,15 +98,7 @@ get_weapon_html weapon =                 )              ]           ), -         (Html.div -            [ -               (Html.Attributes.class "info-card-omnimods-listing") -            ] -            (List.map -               (get_mod_html) -               (Struct.Omnimods.get_all_mods (Struct.Weapon.get_omnimods weapon)) -            ) -         ) +         (View.Omnimods.get_html 1.0 (Struct.Weapon.get_omnimods weapon))        ]     ) | 


