summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/roster-editor/src/View/GlyphSelection.elm')
-rw-r--r--src/roster-editor/src/View/GlyphSelection.elm84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/roster-editor/src/View/GlyphSelection.elm b/src/roster-editor/src/View/GlyphSelection.elm
new file mode 100644
index 0000000..8631a0d
--- /dev/null
+++ b/src/roster-editor/src/View/GlyphSelection.elm
@@ -0,0 +1,84 @@
+module View.GlyphSelection exposing (get_html)
+
+-- Elm -------------------------------------------------------------------------
+import Dict
+
+import Html
+import Html.Attributes
+import Html.Events
+
+-- Roster Editor ---------------------------------------------------------------
+import Struct.Event
+import Struct.Glyph
+import Struct.Omnimods
+import Struct.Model
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_mod_html : (String, Int) -> (Html.Html Struct.Event.Type)
+get_mod_html mod =
+ let
+ (category, value) = mod
+ in
+ (Html.div
+ [
+ (Html.Attributes.class "info-card-mod")
+ ]
+ [
+ (Html.text
+ (category ++ ": " ++ (toString value))
+ )
+ ]
+ )
+
+get_glyph_html : Struct.Glyph.Type -> (Html.Html Struct.Event.Type)
+get_glyph_html glyph =
+ (Html.div
+ [
+ (Html.Attributes.class "character-card-glyph"),
+ (Html.Attributes.class "clickable"),
+ (Html.Events.onClick
+ (Struct.Event.SelectedGlyph
+ (Struct.Glyph.get_id glyph)
+ )
+ )
+ ]
+ [
+ (Html.text (Struct.Glyph.get_name glyph)),
+ (Html.div
+ [
+ ]
+ (List.map
+ (get_mod_html)
+ (Struct.Omnimods.get_all_mods
+ (Struct.Glyph.get_omnimods glyph)
+ )
+ )
+ )
+ ]
+ )
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type)
+get_html model =
+ (Html.div
+ [
+ (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)
+ )
+ )
+ ]
+ )