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/battle/src/View/Controlled/CharacterCard.elm | 36 ++++++++++++++++++++++-- src/battle/src/View/MessageBoard/Help.elm | 10 +++++++ 2 files changed, 43 insertions(+), 3 deletions(-) (limited to 'src/battle') diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm index 19155f3..2416323 100644 --- a/src/battle/src/View/Controlled/CharacterCard.elm +++ b/src/battle/src/View/Controlled/CharacterCard.elm @@ -75,7 +75,17 @@ get_health_bar char = (Battle.View.Gauge.get_html ("HP: " ++ (String.fromInt current) ++ "/" ++ (String.fromInt max)) (100.0 * ((toFloat current)/(toFloat max))) - [(Html.Attributes.class "character-card-health")] + [ + (Html.Attributes.class "character-card-health"), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.RequestedHelp + (Struct.HelpRequest.Statistic + Battle.Struct.Statistics.MaxHealth + ) + ) + ) + ] [] [] ) @@ -145,7 +155,17 @@ get_active_movement_bar maybe_navigator char = (Battle.View.Gauge.get_html ("MP: " ++ (String.fromInt current) ++ "/" ++ (String.fromInt max)) (100.0 * ((toFloat current)/(toFloat max))) - [(Html.Attributes.class "character-card-movement")] + [ + (Html.Attributes.class "character-card-movement"), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.RequestedHelp + (Struct.HelpRequest.Statistic + Battle.Struct.Statistics.MovementPoints + ) + ) + ) + ] [] [] ) @@ -166,7 +186,17 @@ get_inactive_movement_bar char = (Battle.View.Gauge.get_html ( "MP: " ++ (String.fromInt max)) 100.0 - [(Html.Attributes.class "character-card-movement")] + [ + (Html.Attributes.class "character-card-movement"), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.RequestedHelp + (Struct.HelpRequest.Statistic + Battle.Struct.Statistics.MovementPoints + ) + ) + ) + ] [] [] ) diff --git a/src/battle/src/View/MessageBoard/Help.elm b/src/battle/src/View/MessageBoard/Help.elm index 68d6136..9511f96 100644 --- a/src/battle/src/View/MessageBoard/Help.elm +++ b/src/battle/src/View/MessageBoard/Help.elm @@ -4,6 +4,10 @@ module View.MessageBoard.Help exposing (get_html) import Html import Html.Attributes +-- Battle ---------------------------------------------------------------------- +import Battle.View.Help.Attribute +import Battle.View.Help.Statistic + -- Local Module ---------------------------------------------------------------- import Struct.Event import Struct.HelpRequest @@ -34,6 +38,12 @@ get_html model = (Struct.HelpRequest.Rank rank) -> (View.MessageBoard.Help.Rank.get_html_contents rank) + (Struct.HelpRequest.Attribute att_cat) -> + (Battle.View.Help.Attribute.get_html_contents att_cat) + + (Struct.HelpRequest.Statistic stat_cat) -> + (Battle.View.Help.Statistic.get_html_contents stat_cat) + _ -> [(Html.text "Help is not available for this, yet.")] ) ) -- cgit v1.2.3-70-g09d2