summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-01-21 11:30:14 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-01-21 11:30:14 +0100 |
commit | 6a0a6c523839085c18c02d12c4d97a48c1a8d792 (patch) | |
tree | b51937b59b5107596a22f9cc6ca57df221e4b3d6 | |
parent | f49d8cf4f141ec91047e44e711e0ec92b146b9ca (diff) |
Can now change portrait before battle.
-rw-r--r-- | src/roster-editor/src/View/Character.elm | 35 | ||||
-rw-r--r-- | src/roster-editor/src/View/CharacterCard.elm | 4 |
2 files changed, 26 insertions, 13 deletions
diff --git a/src/roster-editor/src/View/Character.elm b/src/roster-editor/src/View/Character.elm index 3f44a80..2ca3636 100644 --- a/src/roster-editor/src/View/Character.elm +++ b/src/roster-editor/src/View/Character.elm @@ -109,18 +109,31 @@ get_battle_index_html char = -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- -get_portrait_html : Struct.Character.Type -> (Html.Html Struct.Event.Type) -get_portrait_html char = +get_portrait_html : ( + Struct.Character.Type -> + Bool -> + (Html.Html Struct.Event.Type) + ) +get_portrait_html char click_to_toggle = (Html.div - [ - (Html.Attributes.class "character-portrait"), - (Html.Attributes.class "character-portrait-team-0"), - (Html.Events.onClick - (Struct.Event.ToggleCharacterBattleIndex - (Struct.Character.get_index char) - ) - ) - ] + ( + [ + (Html.Attributes.class "character-portrait"), + (Html.Attributes.class "character-portrait-team-0") + ] + ++ + if (click_to_toggle) + then + [ + (Html.Events.onClick + (Struct.Event.ToggleCharacterBattleIndex + (Struct.Character.get_index char) + ) + ) + ] + else + [] + ) [ (get_portrait_body_html char), (get_portrait_armor_html char), diff --git a/src/roster-editor/src/View/CharacterCard.elm b/src/roster-editor/src/View/CharacterCard.elm index 4ced7d5..10348ad 100644 --- a/src/roster-editor/src/View/CharacterCard.elm +++ b/src/roster-editor/src/View/CharacterCard.elm @@ -429,7 +429,7 @@ get_minimal_html char = (Html.Attributes.class "info-card-picture") ] [ - (View.Character.get_portrait_html char) + (View.Character.get_portrait_html char True) ] ), (get_health_bar char), @@ -475,7 +475,7 @@ get_full_html char = ) ] [ - (View.Character.get_portrait_html char) + (View.Character.get_portrait_html char False) ] ), (get_health_bar char), |