summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--src/roster-editor/src/Comm/Send.elm2
-rw-r--r--src/roster-editor/src/Comm/SetInventory.elm24
-rw-r--r--src/roster-editor/src/Struct/Inventory.elm75
-rw-r--r--src/roster-editor/src/Struct/Model.elm3
-rw-r--r--src/roster-editor/src/Struct/ServerReply.elm4
-rw-r--r--src/roster-editor/src/Struct/UI.elm1
-rw-r--r--src/roster-editor/src/Update/HandleServerReply.elm24
-rw-r--r--src/roster-editor/src/Update/SelectCharacter.elm6
-rw-r--r--src/roster-editor/src/Update/SelectTab.elm15
-rw-r--r--src/roster-editor/src/View/Character.elm145
-rw-r--r--src/roster-editor/src/View/CharacterCard.elm40
-rw-r--r--src/roster-editor/src/View/Controlled.elm2
-rw-r--r--src/roster-editor/src/View/MainMenu.elm42
-rw-r--r--src/roster-editor/src/View/MessageBoard/Help.elm4
-rw-r--r--src/roster-editor/src/View/MessageBoard/Help/Rank.elm97
16 files changed, 181 insertions, 305 deletions
diff --git a/Makefile b/Makefile
index 3737414..c67fddb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
################################################################################
## CONFIG ######################################################################
################################################################################
-MODULES ?= css global main-menu login map-editor battle asset
+MODULES ?= css global main-menu login roster-editor map-editor battle asset
SRC_DIR = ${CURDIR}/src
WWW_DIR = ${CURDIR}/www
diff --git a/src/roster-editor/src/Comm/Send.elm b/src/roster-editor/src/Comm/Send.elm
index ec9e359..9031258 100644
--- a/src/roster-editor/src/Comm/Send.elm
+++ b/src/roster-editor/src/Comm/Send.elm
@@ -10,6 +10,7 @@ import Json.Encode
import Comm.AddArmor
import Comm.AddChar
import Comm.AddWeapon
+import Comm.SetInventory
import Struct.Event
import Struct.ServerReply
@@ -25,6 +26,7 @@ import Struct.Model
internal_decoder : String -> (Json.Decode.Decoder Struct.ServerReply.Type)
internal_decoder reply_type =
case reply_type of
+ "set_inventory" -> (Comm.SetInventory.decode)
"add_armor" -> (Comm.AddArmor.decode)
"add_char" -> (Comm.AddChar.decode)
"add_weapon" -> (Comm.AddWeapon.decode)
diff --git a/src/roster-editor/src/Comm/SetInventory.elm b/src/roster-editor/src/Comm/SetInventory.elm
new file mode 100644
index 0000000..0c6d9d7
--- /dev/null
+++ b/src/roster-editor/src/Comm/SetInventory.elm
@@ -0,0 +1,24 @@
+module Comm.SetInventory exposing (decode)
+
+-- Elm -------------------------------------------------------------------------
+import Json.Decode
+
+-- Map -------------------------------------------------------------------
+import Struct.Inventory
+import Struct.ServerReply
+
+--------------------------------------------------------------------------------
+-- TYPES -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+internal_decoder : Struct.Inventory.Type -> Struct.ServerReply.Type
+internal_decoder inv = (Struct.ServerReply.SetInventory inv)
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+decode : (Json.Decode.Decoder Struct.ServerReply.Type)
+decode = (Json.Decode.map (internal_decoder) (Struct.Inventory.decoder))
diff --git a/src/roster-editor/src/Struct/Inventory.elm b/src/roster-editor/src/Struct/Inventory.elm
new file mode 100644
index 0000000..a24f31a
--- /dev/null
+++ b/src/roster-editor/src/Struct/Inventory.elm
@@ -0,0 +1,75 @@
+module Struct.Inventory exposing
+ (
+ Type,
+ has_portrait,
+ has_glyph,
+ has_glyph_board,
+ has_weapon,
+ has_armor,
+ empty,
+ decoder
+ )
+
+-- Elm -------------------------------------------------------------------------
+import Json.Decode
+import Json.Decode.Pipeline
+
+import Set
+
+-- Battle ----------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- TYPES -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+type alias Type =
+ {
+ portraits : (Set.Set Int),
+ glyphes : (Set.Set Int),
+ glyph_boards : (Set.Set Int),
+ weapons : (Set.Set Int),
+ armors : (Set.Set Int)
+ }
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+has_portrait : Int -> Type -> Bool
+has_portrait id inv = (Set.member id inv.portraits)
+
+has_glyph : Int -> Type -> Bool
+has_glyph id inv = (Set.member id inv.glyphes)
+
+has_glyph_board : Int -> Type -> Bool
+has_glyph_board id inv = (Set.member id inv.glyph_boards)
+
+has_weapon : Int -> Type -> Bool
+has_weapon id inv = (Set.member id inv.weapons)
+
+has_armor : Int -> Type -> Bool
+has_armor id inv = (Set.member id inv.armors)
+
+empty : Type
+empty =
+ {
+ portraits = (Set.empty),
+ glyphes = (Set.empty),
+ glyph_boards = (Set.empty),
+ weapons = (Set.empty),
+ armors = (Set.empty)
+ }
+
+decoder : (Json.Decode.Decoder Type)
+decoder =
+ -- TODO
+ (Json.Decode.Pipeline.decode
+ Type
+ |> (Json.Decode.Pipeline.hardcoded (Set.empty))
+ |> (Json.Decode.Pipeline.hardcoded (Set.empty))
+ |> (Json.Decode.Pipeline.hardcoded (Set.empty))
+ |> (Json.Decode.Pipeline.hardcoded (Set.empty))
+ |> (Json.Decode.Pipeline.hardcoded (Set.empty))
+ )
diff --git a/src/roster-editor/src/Struct/Model.elm b/src/roster-editor/src/Struct/Model.elm
index 4f240ed..b1abd3a 100644
--- a/src/roster-editor/src/Struct/Model.elm
+++ b/src/roster-editor/src/Struct/Model.elm
@@ -24,6 +24,7 @@ import Struct.Armor
import Struct.Character
import Struct.Error
import Struct.HelpRequest
+import Struct.Inventory
import Struct.Omnimods
import Struct.UI
import Struct.Weapon
@@ -44,6 +45,7 @@ type alias Type =
player_id: String,
roster_id: String,
edited_char: (Maybe Struct.Character.Type),
+ inventory: Struct.Inventory.Type,
session_token: String,
ui: Struct.UI.Type
}
@@ -76,6 +78,7 @@ new flags =
),
session_token = flags.token,
edited_char = Nothing,
+ inventory = (Struct.Inventory.empty),
ui = (Struct.UI.default)
}
in
diff --git a/src/roster-editor/src/Struct/ServerReply.elm b/src/roster-editor/src/Struct/ServerReply.elm
index 50968f6..dddbc23 100644
--- a/src/roster-editor/src/Struct/ServerReply.elm
+++ b/src/roster-editor/src/Struct/ServerReply.elm
@@ -2,9 +2,10 @@ module Struct.ServerReply exposing (Type(..))
-- Elm -------------------------------------------------------------------------
--- Character -------------------------------------------------------------------
+-- Roster Editor ---------------------------------------------------------------
import Struct.Armor
import Struct.Character
+import Struct.Inventory
import Struct.Weapon
--------------------------------------------------------------------------------
@@ -14,6 +15,7 @@ import Struct.Weapon
type Type =
Okay
| Disconnected
+ | SetInventory Struct.Inventory.Type
| AddArmor Struct.Armor.Type
| AddWeapon Struct.Weapon.Type
| AddCharacter (Struct.Character.Type, Int, Int, Int)
diff --git a/src/roster-editor/src/Struct/UI.elm b/src/roster-editor/src/Struct/UI.elm
index 2831bc0..169c883 100644
--- a/src/roster-editor/src/Struct/UI.elm
+++ b/src/roster-editor/src/Struct/UI.elm
@@ -21,6 +21,7 @@ type Tab =
| PortraitSelectionTab
-- | AccessorySelectionTab
| WeaponSelectionTab
+ | ArmorSelectionTab
| GlyphManagementTab
type alias Type =
diff --git a/src/roster-editor/src/Update/HandleServerReply.elm b/src/roster-editor/src/Update/HandleServerReply.elm
index 5b45bb5..2496089 100644
--- a/src/roster-editor/src/Update/HandleServerReply.elm
+++ b/src/roster-editor/src/Update/HandleServerReply.elm
@@ -19,6 +19,7 @@ import Struct.Armor
import Struct.Character
import Struct.Error
import Struct.Event
+import Struct.Inventory
import Struct.Model
import Struct.ServerReply
import Struct.UI
@@ -88,6 +89,15 @@ add_weapon wp current_state =
let (model, cmds) = current_state in
((Struct.Model.add_weapon wp model), cmds)
+set_inventory : (
+ Struct.Inventory.Type ->
+ (Struct.Model.Type, (List (Cmd Struct.Event.Type))) ->
+ (Struct.Model.Type, (List (Cmd Struct.Event.Type)))
+ )
+set_inventory inv current_state =
+ let (model, cmds) = current_state in
+ ({model | inventory = inv}, cmds)
+
add_character : (
(Struct.Character.Type, Int, Int, Int) ->
(Struct.Model.Type, (List (Cmd Struct.Event.Type))) ->
@@ -102,16 +112,7 @@ add_character char_and_refs current_state =
ar = (armor_getter model ar_ref)
in
(
- (Struct.Model.add_character
- (Struct.Character.fill_missing_equipment_and_omnimods
- (Struct.Model.tile_omnimods_fun model)
- awp
- swp
- ar
- char
- )
- model
- ),
+ (Struct.Model.add_character char model),
cmds
)
@@ -127,6 +128,9 @@ apply_command command current_state =
(Struct.ServerReply.AddWeapon wp) ->
(add_weapon wp current_state)
+ (Struct.ServerReply.SetInventory inv) ->
+ (set_inventory inv current_state)
+
(Struct.ServerReply.AddArmor ar) ->
(add_armor ar current_state)
diff --git a/src/roster-editor/src/Update/SelectCharacter.elm b/src/roster-editor/src/Update/SelectCharacter.elm
index ab54e2d..2e2235e 100644
--- a/src/roster-editor/src/Update/SelectCharacter.elm
+++ b/src/roster-editor/src/Update/SelectCharacter.elm
@@ -16,7 +16,11 @@ import Struct.Model
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
-apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type))
+apply_to : (
+ Struct.Model.Type ->
+ Int ->
+ (Struct.Model.Type, (Cmd Struct.Event.Type))
+ )
apply_to model target_char_ix =
-- TODO: store currently edited char, if it exists.
-- Basically, there will be a marker on characters to tell if they've been
diff --git a/src/roster-editor/src/Update/SelectTab.elm b/src/roster-editor/src/Update/SelectTab.elm
index d15a463..a8cf436 100644
--- a/src/roster-editor/src/Update/SelectTab.elm
+++ b/src/roster-editor/src/Update/SelectTab.elm
@@ -19,14 +19,7 @@ apply_to : (
(Struct.Model.Type, (Cmd Struct.Event.Type))
)
apply_to model tab =
- if ((Struct.UI.try_getting_displayed_tab model.ui) == (Just tab))
- then
- (
- {model | ui = (Struct.UI.reset_displayed_tab model.ui)},
- Cmd.none
- )
- else
- (
- {model | ui = (Struct.UI.set_displayed_tab tab model.ui)},
- Cmd.none
- )
+ (
+ {model | ui = (Struct.UI.set_displayed_tab tab model.ui)},
+ Cmd.none
+ )
diff --git a/src/roster-editor/src/View/Character.elm b/src/roster-editor/src/View/Character.elm
index 8aa6217..8148565 100644
--- a/src/roster-editor/src/View/Character.elm
+++ b/src/roster-editor/src/View/Character.elm
@@ -7,86 +7,24 @@ module View.Character exposing
-- Elm -------------------------------------------------------------------------
import Html
import Html.Attributes
-import Html.Events
-- Roster Editor ---------------------------------------------------------------
-import Constants.UI
-
import Util.Html
import Struct.Armor
import Struct.Character
import Struct.Event
import Struct.Model
-import Struct.UI
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
-get_activation_level_class : (
- Struct.Character.Type ->
- (Html.Attribute Struct.Event.Type)
- )
-get_activation_level_class char =
- if (Struct.Character.is_enabled char)
- then
- (Html.Attributes.class "battle-character-icon-enabled")
- else
- (Html.Attributes.class "battle-character-icon-disabled")
-
-get_alliance_class : (
- Struct.Model.Type ->
- Struct.Character.Type ->
- (Html.Attribute Struct.Event.Type)
- )
-get_alliance_class model char =
- if ((Struct.Character.get_player_ix char) == model.player_ix)
- then
- (Html.Attributes.class "battle-character-ally")
- else
- (Html.Attributes.class "battle-character-enemy")
-
-get_position_style : (
- Struct.Character.Type ->
- (Html.Attribute Struct.Event.Type)
- )
-get_position_style char =
- let char_loc = (Struct.Character.get_location char) in
- (Html.Attributes.style
- [
- ("top", ((toString (char_loc.y * Constants.UI.tile_size)) ++ "px")),
- ("left", ((toString (char_loc.x * Constants.UI.tile_size)) ++ "px"))
- ]
- )
-
-get_focus_class : (
- Struct.Model.Type ->
- Struct.Character.Type ->
- (Html.Attribute Struct.Event.Type)
- )
-get_focus_class model char =
- if
- (
- (Struct.UI.get_previous_action model.ui)
- ==
- (Just (Struct.UI.SelectedCharacter (Struct.Character.get_index char)))
- )
- then
- (Html.Attributes.class "battle-character-selected")
- else
- (Html.Attributes.class "")
-
get_icon_body_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
get_icon_body_html char =
(Html.div
[
(Html.Attributes.class "battle-character-icon-body"),
- (Html.Attributes.class
- (
- "asset-character-team-body-"
- ++ (toString (Struct.Character.get_player_ix char))
- )
- )
+ (Html.Attributes.class "asset-character-team-body-0")
]
[
]
@@ -98,38 +36,13 @@ get_icon_head_html char =
[
(Html.Attributes.class "battle-character-icon-head"),
(Html.Attributes.class
- ("asset-character-icon-" ++ (Struct.Character.get_icon_id char))
+ ("asset-character-icon-" ++ (Struct.Character.get_portrait_id char))
)
]
[
]
)
-get_icon_actual_html : (
- Struct.Model.Type ->
- Struct.Character.Type ->
- (Html.Html Struct.Event.Type)
- )
-get_icon_actual_html model char =
- (Html.div
- [
- (Html.Attributes.class "battle-tiled"),
- (Html.Attributes.class "battle-character-icon"),
- (get_activation_level_class char),
- (get_alliance_class model char),
- (get_position_style char),
- (get_focus_class model char),
- (Html.Attributes.class "clickable"),
- (Html.Events.onClick
- (Struct.Event.CharacterSelected (Struct.Character.get_index char))
- )
- ]
- [
- (get_icon_body_html char),
- (get_icon_head_html char)
- ]
- )
-
get_portrait_body_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
get_portrait_body_html char =
(Html.div
@@ -160,8 +73,8 @@ get_portrait_armor_html char =
),
(Html.Attributes.class
(
- "asset-armor-variation-"
- ++ (Struct.Character.get_armor_variation char)
+ "asset-armor-variation-0"
+ -- TODO: link this to the portrait.
)
)
]
@@ -172,34 +85,12 @@ get_portrait_armor_html char =
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
-get_portrait_html : (
- Int ->
- Struct.Character.Type ->
- (Html.Html Struct.Event.Type)
- )
-get_portrait_html viewer_ix char =
+get_portrait_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
+get_portrait_html char =
(Html.div
[
- (Html.Attributes.class
- (
- if ((Struct.Character.get_player_ix char) == viewer_ix)
- then
- "battle-character-ally"
- else
- "battle-character-enemy"
- )
- ),
(Html.Attributes.class "battle-character-portrait"),
- (Html.Attributes.class
- (
- "battle-character-portrait-team-"
- ++
- (toString (Struct.Character.get_player_ix char))
- )
- ),
- (Html.Events.onClick
- (Struct.Event.LookingForCharacter (Struct.Character.get_index char))
- )
+ (Html.Attributes.class "battle-character-portrait-team-0")
]
[
(get_portrait_body_html char),
@@ -207,14 +98,16 @@ get_portrait_html viewer_ix char =
]
)
-get_icon_html : (
- Struct.Model.Type ->
- Struct.Character.Type ->
- (Html.Html Struct.Event.Type)
+get_icon_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
+get_icon_html char =
+ (Html.div
+ [
+ (Html.Attributes.class "battle-tiled"),
+ (Html.Attributes.class "battle-character-icon"),
+ (Html.Attributes.class "clickable")
+ ]
+ [
+ (get_icon_body_html char),
+ (get_icon_head_html char)
+ ]
)
-get_icon_html model char =
- if (Struct.Character.is_alive char)
- then
- (get_icon_actual_html model char)
- else
- (Util.Html.nothing)
diff --git a/src/roster-editor/src/View/CharacterCard.elm b/src/roster-editor/src/View/CharacterCard.elm
index 4592267..dfb2d0e 100644
--- a/src/roster-editor/src/View/CharacterCard.elm
+++ b/src/roster-editor/src/View/CharacterCard.elm
@@ -1,7 +1,6 @@
module View.CharacterCard exposing
(
get_minimal_html,
- get_summary_html,
get_full_html
)
@@ -52,49 +51,19 @@ get_health_bar : (
)
get_health_bar char =
let
- current = (Struct.Character.get_sane_current_health char)
max =
(Struct.Statistics.get_max_health
(Struct.Character.get_statistics char)
)
in
(View.Gauge.get_html
- ("HP: " ++ (toString current) ++ "/" ++ (toString max))
- (100.0 * ((toFloat current)/(toFloat max)))
+ ("HP: " ++ (toString max))
+ 100.0
[(Html.Attributes.class "roster-character-card-health")]
[]
[]
)
-get_rank_status : (
- Struct.Character.Rank ->
- (Html.Html Struct.Event.Type)
- )
-get_rank_status rank =
- (Html.div
- [
- (Html.Attributes.class "roster-character-card-status"),
- (Html.Attributes.class "clickable"),
- (Html.Events.onClick
- (Struct.Event.RequestedHelp (Struct.HelpRequest.HelpOnRank rank))
- ),
- (Html.Attributes.class
- (
- case rank of
- Struct.Character.Commander ->
- "roster-character-card-commander-status"
-
- Struct.Character.Target ->
- "roster-character-card-target-status"
-
- Struct.Character.Optional -> ""
- )
- )
- ]
- [
- ]
- )
-
get_statuses : (
Struct.Character.Type ->
(Html.Html Struct.Event.Type)
@@ -105,11 +74,6 @@ get_statuses char =
(Html.Attributes.class "roster-character-card-statuses")
]
[
- (
- case (Struct.Character.get_rank char) of
- Struct.Character.Optional -> (Util.Html.nothing)
- other -> (get_rank_status other)
- )
]
)
diff --git a/src/roster-editor/src/View/Controlled.elm b/src/roster-editor/src/View/Controlled.elm
index 45c8a70..5e703b7 100644
--- a/src/roster-editor/src/View/Controlled.elm
+++ b/src/roster-editor/src/View/Controlled.elm
@@ -29,7 +29,7 @@ get_html model =
[(Html.Attributes.class "roster-editor-controlled")]
[
(Html.Lazy.lazy
- (View.CharacterCard.get_summary_html)
+ (View.CharacterCard.get_full_html)
char
)
]
diff --git a/src/roster-editor/src/View/MainMenu.elm b/src/roster-editor/src/View/MainMenu.elm
index 96bf539..2a5b7bb 100644
--- a/src/roster-editor/src/View/MainMenu.elm
+++ b/src/roster-editor/src/View/MainMenu.elm
@@ -12,13 +12,6 @@ import Struct.UI
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
-get_menu_button_html : Struct.UI.Tab -> (Html.Html Struct.Event.Type)
-get_menu_button_html tab =
- (Html.button
- [ (Html.Events.onClick (Struct.Event.TabSelected tab)) ]
- [ (Html.text (Struct.UI.to_string tab)) ]
- )
-
get_main_menu_button_html : (Html.Html Struct.Event.Type)
get_main_menu_button_html =
(Html.button
@@ -26,6 +19,27 @@ get_main_menu_button_html =
[ (Html.text "Main Menu") ]
)
+get_characters_button_html : (Html.Html Struct.Event.Type)
+get_characters_button_html =
+ (Html.button
+ [ (Html.Events.onClick Struct.Event.GoToMainMenu) ]
+ [ (Html.text "Characters") ]
+ )
+
+get_reset_button_html : (Html.Html Struct.Event.Type)
+get_reset_button_html =
+ (Html.button
+ [ ]
+ [ (Html.text "Reset") ]
+ )
+
+get_save_button_html : (Html.Html Struct.Event.Type)
+get_save_button_html =
+ (Html.button
+ [ ]
+ [ (Html.text "Save") ]
+ )
+
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
@@ -35,12 +49,10 @@ get_html =
[
(Html.Attributes.class "battle-main-menu")
]
- (
- (get_main_menu_button_html)
- ::
- (List.map
- (get_menu_button_html)
- (Struct.UI.get_all_tabs)
- )
- )
+ [
+ (get_main_menu_button_html),
+ (get_reset_button_html),
+ (get_characters_button_html),
+ (get_save_button_html)
+ ]
)
diff --git a/src/roster-editor/src/View/MessageBoard/Help.elm b/src/roster-editor/src/View/MessageBoard/Help.elm
index 6c20bbc..daefba5 100644
--- a/src/roster-editor/src/View/MessageBoard/Help.elm
+++ b/src/roster-editor/src/View/MessageBoard/Help.elm
@@ -10,7 +10,6 @@ import Struct.HelpRequest
import Struct.Model
import View.MessageBoard.Help.Guide
-import View.MessageBoard.Help.Rank
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
@@ -30,8 +29,5 @@ get_html model =
case model.help_request of
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/roster-editor/src/View/MessageBoard/Help/Rank.elm b/src/roster-editor/src/View/MessageBoard/Help/Rank.elm
deleted file mode 100644
index 4a01e75..0000000
--- a/src/roster-editor/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
-
--- Map -------------------------------------------------------------------
-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 "battle-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
- "battle-message-board-help-figure"
- ),
- (Html.Attributes.class
- ("battle-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)