From 8bcf0d47a363ef0c45b7fbcbc95fb770aecc20c0 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 3 May 2019 11:08:16 +0200 Subject: Adds some help for stats & attributes. --- src/shared/battle/Battle/View/Help/Attribute.elm | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/shared/battle/Battle/View/Help/Attribute.elm (limited to 'src/shared/battle/Battle/View/Help/Attribute.elm') diff --git a/src/shared/battle/Battle/View/Help/Attribute.elm b/src/shared/battle/Battle/View/Help/Attribute.elm new file mode 100644 index 0000000..f7bd9e1 --- /dev/null +++ b/src/shared/battle/Battle/View/Help/Attribute.elm @@ -0,0 +1,62 @@ +module Battle.View.Help.Attribute exposing (get_html_contents) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes + +-- Battle ---------------------------------------------------------------------- +import Battle.Struct.Attributes +import Battle.Lang.English + +-- Local Module ---------------------------------------------------------------- +import Struct.Event + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_header_html : ( + Battle.Struct.Attributes.Category -> + String -> + (Html.Html Struct.Event.Type) + ) +get_header_html cat name = + (Html.h1 + [] + [ + (Html.div + [(Html.Attributes.class "help-guide-icon")] + [] + ), + (Html.text " "), + (Html.div + [ + (Html.Attributes.class "omnimod-icon"), + (Html.Attributes.class + ( + "omnimod-icon-" + ++ (Battle.Struct.Attributes.encode_category cat) + ) + ) + ] + [ + ] + ), + (Html.text name) + ] + ) + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html_contents : ( + Battle.Struct.Attributes.Category -> + (List (Html.Html Struct.Event.Type)) + ) +get_html_contents cat = + let + (name, tooltip) = (Battle.Lang.English.get_attribute_category_help cat) + in + [ + (get_header_html cat name), + tooltip + ] -- cgit v1.2.3-70-g09d2