summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/roster-editor/src/View/GlyphSelection.elm')
-rw-r--r-- | src/roster-editor/src/View/GlyphSelection.elm | 71 |
1 files changed, 57 insertions, 14 deletions
diff --git a/src/roster-editor/src/View/GlyphSelection.elm b/src/roster-editor/src/View/GlyphSelection.elm index d1125f6..67faf59 100644 --- a/src/roster-editor/src/View/GlyphSelection.elm +++ b/src/roster-editor/src/View/GlyphSelection.elm @@ -1,6 +1,10 @@ module View.GlyphSelection exposing (get_html) -- Elm ------------------------------------------------------------------------- +import Array + +import Set + import Dict import Html @@ -8,14 +12,21 @@ import Html.Attributes import Html.Events -- Battle ---------------------------------------------------------------------- +import Battle.Struct.Omnimods + import Battle.View.Omnimods -- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Character +import BattleCharacters.Struct.Equipment import BattleCharacters.Struct.Glyph +import BattleCharacters.Struct.GlyphBoard -- Local Module ---------------------------------------------------------------- +import Struct.Character import Struct.Event import Struct.Model +import Struct.UI -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -35,14 +46,27 @@ get_mod_html mod = ) get_glyph_html : ( + (Set.Set BattleCharacters.Struct.Glyph.Ref) -> + Float -> BattleCharacters.Struct.Glyph.Type -> (Html.Html Struct.Event.Type) ) -get_glyph_html glyph = +get_glyph_html invalid_family_ids factor glyph = (Html.div [ (Html.Attributes.class "character-card-glyph"), (Html.Attributes.class "clickable"), + (Html.Attributes.class + ( + if + (Set.member + (BattleCharacters.Struct.Glyph.get_family_id glyph) + invalid_family_ids + ) + then "roster-editor-forbidden-glyph" + else "roster-editor-allowed-glyph" + ) + ), (Html.Events.onClick (Struct.Event.SelectedGlyph (BattleCharacters.Struct.Glyph.get_id glyph) @@ -52,7 +76,10 @@ get_glyph_html glyph = [ (Html.text (BattleCharacters.Struct.Glyph.get_name glyph)), (Battle.View.Omnimods.get_html - (BattleCharacters.Struct.Glyph.get_omnimods glyph) + (Battle.Struct.Omnimods.scale + factor + (BattleCharacters.Struct.Glyph.get_omnimods glyph) + ) ) ] ) @@ -67,16 +94,32 @@ get_html model = (Html.Attributes.class "selection-window"), (Html.Attributes.class "glyph-management") ] - [ - (Html.text "Glyph Selection"), - (Html.div - [ - (Html.Attributes.class "selection-window-listing") - ] - (List.map - (get_glyph_html) - (Dict.values model.glyphs) - ) - ) - ] + ( + case model.edited_char of + Nothing -> [ (Html.text "Choose a character first.") ] + (Just char) -> + let + (slot_index, glyph_modifier) = + (Struct.UI.get_glyph_slot model.ui) + glyph_multiplier = + ((toFloat glyph_modifier) / 100.0) + used_glyph_family_indices = + (Struct.Character.get_all_glyph_family_indices char) + in + [ + (Html.text "Glyph Selection"), + (Html.div + [ + (Html.Attributes.class "selection-window-listing") + ] + (List.map + (get_glyph_html + used_glyph_family_indices + glyph_multiplier + ) + (Dict.values model.glyphs) + ) + ) + ] + ) ) |