summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-03-04 14:38:49 +0100 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-03-04 14:38:49 +0100 |
commit | 4905bb9d6322c14034ef3278f67917cf09aae8be (patch) | |
tree | 40a02a1c23c82d8dd2adbaa6e461f0df226c3fca /src/battle/src/View | |
parent | f6fbffbe6aac7e499db1db5a453b84885bb4b1db (diff) |
...
Diffstat (limited to 'src/battle/src/View')
-rw-r--r-- | src/battle/src/View/Controlled/CharacterCard.elm | 66 | ||||
-rw-r--r-- | src/battle/src/View/Map/Character.elm | 24 | ||||
-rw-r--r-- | src/battle/src/View/MessageBoard/Help.elm | 4 | ||||
-rw-r--r-- | src/battle/src/View/MessageBoard/Help/Rank.elm | 97 |
4 files changed, 36 insertions, 155 deletions
diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm index 2fea74c..45e58d9 100644 --- a/src/battle/src/View/Controlled/CharacterCard.elm +++ b/src/battle/src/View/Controlled/CharacterCard.elm @@ -28,6 +28,7 @@ import Battle.View.DamageType import BattleCharacters.Struct.Armor import BattleCharacters.Struct.Character import BattleCharacters.Struct.Equipment +import BattleCharacters.Struct.Skill import BattleCharacters.Struct.Weapon -- Local Module ---------------------------------------------------------------- @@ -58,10 +59,7 @@ get_name base_char = ] ) -get_health_bar : ( - Struct.Character.Type -> - (Html.Html Struct.Event.Type) - ) +get_health_bar : Struct.Character.Type -> (Html.Html Struct.Event.Type) get_health_bar char = let current = (Struct.Character.get_sane_current_health char) @@ -90,31 +88,37 @@ get_health_bar char = [] ) -get_rank_status : Struct.Character.Rank -> (Html.Html Struct.Event.Type) -get_rank_status rank = - (Html.div - [ - (Html.Attributes.class "character-card-status"), - (Html.Attributes.class "clickable"), - (Html.Events.onClick - (Struct.Event.RequestedHelp (Struct.HelpRequest.Rank rank)) - ), - (Html.Attributes.class - ( - case rank of - Struct.Character.Commander -> - "character-card-commander-status" - - Struct.Character.Target -> - "character-card-target-status" - - Struct.Character.Optional -> "" +get_skill_points_bar : Struct.Character.Type -> (Html.Html Struct.Event.Type) +get_skill_points_bar char = + let + current = (Struct.Character.get_current_skill_points char) + max = + (BattleCharacters.Struct.Skill.get_reserve + (BattleCharacters.Struct.Equipment.get_skill + (BattleCharacters.Struct.Character.get_equipment + (Struct.Character.get_base_character char) + ) ) ) - ] - [ - ] - ) + in + (Battle.View.Gauge.get_html + ("SP: " ++ (String.fromInt current) ++ "/" ++ (String.fromInt max)) + (100.0 * ((toFloat current)/(toFloat max))) + [ + (Html.Attributes.class "character-card-skill-points"), + (Html.Attributes.class "clickable") + -- TODO: Clicking should display help about skill points. +-- (Html.Events.onClick +-- (Struct.Event.RequestedHelp +-- (Struct.HelpRequest.Attribute +-- Battle.Struct.Attributes.SkillPoints +-- ) +-- ) +-- ) + ] + [] + [] + ) get_statuses : Struct.Character.Type -> (Html.Html Struct.Event.Type) get_statuses char = @@ -123,11 +127,6 @@ get_statuses char = (Html.Attributes.class "character-card-statuses") ] [ - ( - case (Struct.Character.get_rank char) of - Struct.Character.Optional -> (Util.Html.nothing) - other -> (get_rank_status other) - ) ] ) @@ -357,6 +356,7 @@ get_minimal_html player_ix char = ), (get_health_bar char), (get_inactive_movement_bar char), + (get_skill_points_bar char), (get_statuses char) ] ) @@ -405,6 +405,7 @@ get_summary_html char_turn player_ix char = ), (get_health_bar char), (get_movement_bar char_turn char), + (get_skill_points_bar char), (get_statuses char) ] ), @@ -461,6 +462,7 @@ get_full_html player_ix char = ), (get_health_bar char), (get_inactive_movement_bar char), + (get_skill_points_bar char), (get_statuses char) ] ), diff --git a/src/battle/src/View/Map/Character.elm b/src/battle/src/View/Map/Character.elm index b1442b1..1afffeb 100644 --- a/src/battle/src/View/Map/Character.elm +++ b/src/battle/src/View/Map/Character.elm @@ -79,28 +79,8 @@ get_head_html char = get_banner_html : Struct.Character.Type -> (Html.Html Struct.Event.Type) get_banner_html char = - case (Struct.Character.get_rank char) of - Struct.Character.Commander -> - (Html.div - [ - (Html.Attributes.class "character-icon-banner"), - (Html.Attributes.class "asset-character-icon-commander-banner") - ] - [ - ] - ) - - Struct.Character.Target -> - (Html.div - [ - (Html.Attributes.class "character-icon-banner"), - (Html.Attributes.class "asset-character-icon-target-banner") - ] - [ - ] - ) - - _ -> (Util.Html.nothing) + -- TODO: Banner from some status indicator + (Util.Html.nothing) get_actual_html : Struct.Character.Type -> (Html.Html Struct.Event.Type) get_actual_html char = diff --git a/src/battle/src/View/MessageBoard/Help.elm b/src/battle/src/View/MessageBoard/Help.elm index 038183f..306d6df 100644 --- a/src/battle/src/View/MessageBoard/Help.elm +++ b/src/battle/src/View/MessageBoard/Help.elm @@ -14,7 +14,6 @@ import Struct.HelpRequest import Struct.Model import View.MessageBoard.Help.Guide -import View.MessageBoard.Help.Rank -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -39,9 +38,6 @@ get_html model help_request = Struct.HelpRequest.None -> (View.MessageBoard.Help.Guide.get_html_contents 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) diff --git a/src/battle/src/View/MessageBoard/Help/Rank.elm b/src/battle/src/View/MessageBoard/Help/Rank.elm deleted file mode 100644 index a4634a4..0000000 --- a/src/battle/src/View/MessageBoard/Help/Rank.elm +++ /dev/null @@ -1,97 +0,0 @@ -module View.MessageBoard.Help.Rank exposing (get_html_contents) - --- Elm ------------------------------------------------------------------------- -import Html -import Html.Attributes - --- Local Module ---------------------------------------------------------------- -import Struct.Character -import Struct.Event - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_guide_icon_html : (Html.Html Struct.Event.Type) -get_guide_icon_html = - (Html.div - [(Html.Attributes.class "help-guide-icon")] - [] - ) - -get_header_with_icon_html : String -> String -> (Html.Html Struct.Event.Type) -get_header_with_icon_html title rank_name = - (Html.h1 - [] - [ - (get_guide_icon_html), - (Html.text (title ++ " - ")), - (Html.div - [ - (Html.Attributes.class - "message-board-help-figure" - ), - (Html.Attributes.class - ("character-card-" ++ rank_name ++ "-status") - ) - ] - [] - ) - ] - ) - -get_target_help_message : (List (Html.Html Struct.Event.Type)) -get_target_help_message = - [ - (get_header_with_icon_html "Protected Character" "target"), - (Html.text - ( - "Players that lose all of their Protected Characters are" - ++ " eliminated." - ) - ) - ] - -get_commander_help_message : (List (Html.Html Struct.Event.Type)) -get_commander_help_message = - [ - (get_header_with_icon_html "Critical Character" "commander"), - (Html.text - ( - "Players that lose any of their Critical Characters are" - ++ " eliminated." - ) - ) - ] - -get_optional_help_message : (List (Html.Html Struct.Event.Type)) -get_optional_help_message = - [ - (Html.h1 - [] - [ - (get_guide_icon_html), - (Html.text "Reinforcement Character") - ] - ), - (Html.text - ( - "Unless it is their very last character, losing a" - ++ " Reinforcement characters never causes a player to be" - ++ " eliminated." - ) - ) - ] - - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_html_contents : ( - Struct.Character.Rank -> - (List (Html.Html Struct.Event.Type)) - ) -get_html_contents rank = - case rank of - Struct.Character.Target -> (get_target_help_message) - Struct.Character.Commander -> (get_commander_help_message) - Struct.Character.Optional -> (get_optional_help_message) |