| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-07 22:25:10 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-07 22:25:10 +0200 | 
| commit | cd3cfd38bf25c6c307639e5c182fd8312db8ba33 (patch) | |
| tree | 45e5ddf37ac192b86bd3c55d1725635ec88adf05 /src | |
| parent | 4401d11e6a8f930a89dc81e4984ca0c768cfea7c (diff) | |
Code cleaning, darker favicon borders.
Diffstat (limited to 'src')
| -rw-r--r-- | src/battlemap/src/View/MessageBoard/Help.elm | 176 | ||||
| -rw-r--r-- | src/battlemap/src/View/MessageBoard/Help/Guide.elm | 100 | ||||
| -rw-r--r-- | src/battlemap/src/View/MessageBoard/Help/Rank.elm | 97 | 
3 files changed, 205 insertions, 168 deletions
| diff --git a/src/battlemap/src/View/MessageBoard/Help.elm b/src/battlemap/src/View/MessageBoard/Help.elm index 773210e..15a33a5 100644 --- a/src/battlemap/src/View/MessageBoard/Help.elm +++ b/src/battlemap/src/View/MessageBoard/Help.elm @@ -5,179 +5,16 @@ import Html  import Html.Attributes  -- Battlemap ------------------------------------------------------------------- -import Struct.Character -import Struct.CharacterTurn  import Struct.Event  import Struct.HelpRequest  import Struct.Model +import View.MessageBoard.Help.Guide +import View.MessageBoard.Help.Rank +  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- -get_rank_help_message : ( -      Struct.Character.Rank -> -      (List (Html.Html Struct.Event.Type)) -   ) -get_rank_help_message rank = -   case rank of -      Struct.Character.Target -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Protected Character - "), -                  (Html.div -                     [ -                        (Html.Attributes.class -                           "battlemap-message-board-help-figure" -                        ), -                        (Html.Attributes.class -                           "battlemap-character-card-target-status" -                        ) -                     ] -                     [] -                  ) -               ] -            ), -            (Html.text -               ( -                  "Players that lose all of their protected characters are" -                  ++ " eliminated." -               ) -            ) -         ] - -      Struct.Character.Commander -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Critical Character - "), -                  (Html.div -                     [ -                        (Html.Attributes.class -                           "battlemap-message-board-help-figure" -                        ), -                        (Html.Attributes.class -                           "battlemap-character-card-commander-status" -                        ) -                     ] -                     [] -                  ) -               ] -            ), -            (Html.text -               ( -                  "Players that lose any of their protected characters are" -                  ++ " eliminated." -               ) -            ) -         ] - -      Struct.Character.Optional -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Reinforcement Character") -               ] -            ), -            (Html.text -               ( -                  "Unless it is their very last character, losing a" -                  ++ " Reinforcement characters never causes a player to be" -                  ++ " eliminated." -               ) -            ) -         ] - -get_guide_icon : (Html.Html Struct.Event.Type) -get_guide_icon = -   (Html.div -      [(Html.Attributes.class "battlemap-help-guide-icon")] -      [] -   ) - -get_default_help_message : ( -      Struct.Model.Type -> -      (List (Html.Html Struct.Event.Type)) -   ) -get_default_help_message model = -   case (Struct.CharacterTurn.get_state model.char_turn) of -      Struct.CharacterTurn.SelectedCharacter -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Character Selected") -               ] -            ), -            (Html.text -               ( -                  "Click on a target tile to select a path or use the manual" -                  ++ " controls to make your own. Click on the destination tile" -                  ++ " again to confirm." -               ) -            ) -         ] - -      Struct.CharacterTurn.MovedCharacter -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Character Moved") -               ] -            ), -            (Html.text -               ( -                  "You can now choose a target in range. Dashed tiles indicate" -                  ++ " where your character will not be able to defend against" -                  ++ " counter attacks." -               ) -            ) -         ] - -      Struct.CharacterTurn.ChoseTarget -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Target Selected") -               ] -            ), -            (Html.text -               ( -                  "If you are satisfied with your choices, end the turn to" -                  ++ " confirm them." -               ) -            ) -         ] - -      _ -> -         [ -            (Html.h1 -               [] -               [ -                  (get_guide_icon), -                  (Html.text "Selecting a Character") -               ] -            ), -            (Html.text -               ( -                  "Click once on a character to focus them. This will show you" -                  ++ " their stats, equipment, and other infos. If they are in" -                  ++ " your team and active (the pulsating characters)," -                  ++ " clicking on them again will let you take control." -               ) -            ) -         ]  --------------------------------------------------------------------------------  -- EXPORTED -------------------------------------------------------------------- @@ -191,7 +28,10 @@ get_html model =        ]        (           case model.help_request of -            Struct.HelpRequest.None -> (get_default_help_message model) -            (Struct.HelpRequest.HelpOnRank rank) -> (get_rank_help_message rank) +            Struct.HelpRequest.None -> +               (View.MessageBoard.Help.Guide.get_html_contents model) + +            (Struct.HelpRequest.HelpOnRank rank) -> +               (View.MessageBoard.Help.Rank.get_html_contents rank)        )     ) diff --git a/src/battlemap/src/View/MessageBoard/Help/Guide.elm b/src/battlemap/src/View/MessageBoard/Help/Guide.elm new file mode 100644 index 0000000..a10b96e --- /dev/null +++ b/src/battlemap/src/View/MessageBoard/Help/Guide.elm @@ -0,0 +1,100 @@ +module View.MessageBoard.Help.Guide exposing (get_html_contents) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes + +-- Battlemap ------------------------------------------------------------------- +import Struct.CharacterTurn +import Struct.Event +import Struct.Model + +-------------------------------------------------------------------------------- +-- LOCAL ----------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_header_html : (String -> (Html.Html Struct.Event.Type)) +get_header_html title = +   (Html.h1 +      [] +      [ +         (Html.div +            [(Html.Attributes.class "battlemap-help-guide-icon")] +            [] +         ), +         (Html.text title) +      ] +   ) + +get_selected_character_html_contents : (List (Html.Html Struct.Event.Type)) +get_selected_character_html_contents = +   [ +      (get_header_html "Controlling a Character"), +      (Html.text +         ( +            "Click on a target tile to select a path or use the manual" +            ++ " controls (on the left panel) to make your own. Click on the" +            ++ " destination tile again to confirm (this can be reverted)." +         ) +      ) +   ] + +get_moved_character_html_contents : (List (Html.Html Struct.Event.Type)) +get_moved_character_html_contents = +   [ +      (get_header_html "Selecting a Target"), +      (Html.text +         ( +            "You can now choose a target in range. Dashed tiles indicate" +            ++ " where your character will not be able to defend themselves" +            ++ " against counter attacks." +         ) +      ) +   ] + +get_chose_target_html_contents : (List (Html.Html Struct.Event.Type)) +get_chose_target_html_contents = +   [ +      (get_header_html "Finalizing the Character's Turn"), +      (Html.text +         ( +            "If you are satisfied with your choices, you can end this" +            ++ " character's turn and see the results unfold. Otherwise, click" +            ++ " on the abort button to undo it all." +         ) +      ) +   ] + +get_default_html_contents : (List (Html.Html Struct.Event.Type)) +get_default_html_contents = +   [ +      (get_header_html "Selecting a Character"), +      (Html.text +         ( +            "Click once on a character to focus them. This will show you" +            ++ " their stats, equipment, and other infos. If they are in" +            ++ " your team and active (the pulsating characters)," +            ++ " clicking on them again will let you take control." +         ) +      ) +   ] + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html_contents : ( +      Struct.Model.Type -> +      (List (Html.Html Struct.Event.Type)) +   ) +get_html_contents model = +   case (Struct.CharacterTurn.get_state model.char_turn) of +      Struct.CharacterTurn.SelectedCharacter -> +         (get_selected_character_html_contents) + +      Struct.CharacterTurn.MovedCharacter -> +         (get_moved_character_html_contents) + +      Struct.CharacterTurn.ChoseTarget -> +         (get_chose_target_html_contents) + +      _ -> +         (get_default_html_contents) diff --git a/src/battlemap/src/View/MessageBoard/Help/Rank.elm b/src/battlemap/src/View/MessageBoard/Help/Rank.elm new file mode 100644 index 0000000..95477d3 --- /dev/null +++ b/src/battlemap/src/View/MessageBoard/Help/Rank.elm @@ -0,0 +1,97 @@ +module View.MessageBoard.Help.Rank exposing (get_html_contents) + +-- Elm ------------------------------------------------------------------------- +import Html +import Html.Attributes + +-- Battlemap ------------------------------------------------------------------- +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 "battlemap-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 +                  "battlemap-message-board-help-figure" +               ), +               (Html.Attributes.class +                  ("battlemap-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) | 


