summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-11-07 10:27:03 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-11-07 10:27:03 +0100 |
commit | 4d7d25a504b99eae52a2122c93ca0d087e145239 (patch) | |
tree | 1a50fc43d930781da058a13a5e8767b27ce8d055 | |
parent | 14db0da97f92c3c47c270793c87a86ebac34cdac (diff) |
Primary & secondary weapons selection.
-rw-r--r-- | src/css/src/roster-editor/info-card/character.scss | 6 | ||||
-rw-r--r-- | src/roster-editor/src/ElmModule/Update.elm | 9 | ||||
-rw-r--r-- | src/roster-editor/src/Struct/Event.elm | 1 | ||||
-rw-r--r-- | src/roster-editor/src/Struct/UI.elm | 5 | ||||
-rw-r--r-- | src/roster-editor/src/View/CharacterCard.elm | 8 |
5 files changed, 23 insertions, 6 deletions
diff --git a/src/css/src/roster-editor/info-card/character.scss b/src/css/src/roster-editor/info-card/character.scss index 0888c0d..92e4558 100644 --- a/src/css/src/roster-editor/info-card/character.scss +++ b/src/css/src/roster-editor/info-card/character.scss @@ -132,3 +132,9 @@ padding: 0.3em; margin-top: 0.3em; } + +.asset-armor-variation-bird +{ + background-size: 200% 100%; + background-position: 100% 0; +} diff --git a/src/roster-editor/src/ElmModule/Update.elm b/src/roster-editor/src/ElmModule/Update.elm index dce9852..02e417a 100644 --- a/src/roster-editor/src/ElmModule/Update.elm +++ b/src/roster-editor/src/ElmModule/Update.elm @@ -5,6 +5,7 @@ module ElmModule.Update exposing (update) -- Roster Editor --------------------------------------------------------------- import Struct.Event import Struct.Model +import Struct.UI import Update.GoToMainMenu import Update.HandleServerReply @@ -49,6 +50,14 @@ update event model = (Struct.Event.TabSelected tab) -> (Update.SelectTab.apply_to new_model tab) + (Struct.Event.ClickedOnWeapon is_main) -> + (Update.SelectTab.apply_to + {model | + ui = (Struct.UI.set_is_selecting_main_weapon is_main model.ui) + } + Struct.UI.WeaponSelectionTab + ) + (Struct.Event.ServerReplied result) -> (Update.HandleServerReply.apply_to model result) diff --git a/src/roster-editor/src/Struct/Event.elm b/src/roster-editor/src/Struct/Event.elm index 7574f62..4bb1083 100644 --- a/src/roster-editor/src/Struct/Event.elm +++ b/src/roster-editor/src/Struct/Event.elm @@ -25,6 +25,7 @@ type Type = | RequestedHelp Struct.HelpRequest.Type | ServerReplied (Result Http.Error (List Struct.ServerReply.Type)) | TabSelected Struct.UI.Tab + | ClickedOnWeapon Bool | SelectedArmor Struct.Armor.Ref | SelectedGlyph (Struct.Glyph.Ref, Int) diff --git a/src/roster-editor/src/Struct/UI.elm b/src/roster-editor/src/Struct/UI.elm index cd72247..f3ed05d 100644 --- a/src/roster-editor/src/Struct/UI.elm +++ b/src/roster-editor/src/Struct/UI.elm @@ -7,6 +7,8 @@ module Struct.UI exposing get_displayed_tab, set_displayed_tab, reset_displayed_tab, + -- Main or Secondary Weapon? + set_is_selecting_main_weapon, is_selecting_main_weapon ) @@ -55,5 +57,8 @@ set_displayed_tab tab ui = {ui | displayed_tab = tab} reset_displayed_tab : Type -> Type reset_displayed_tab ui = {ui | displayed_tab = CharacterSelectionTab} +set_is_selecting_main_weapon : Bool -> Type -> Type +set_is_selecting_main_weapon val ui = {ui | is_selecting_main_weapon = val} + is_selecting_main_weapon : Type -> Bool is_selecting_main_weapon ui = ui.is_selecting_main_weapon diff --git a/src/roster-editor/src/View/CharacterCard.elm b/src/roster-editor/src/View/CharacterCard.elm index 432a8e3..aa3e922 100644 --- a/src/roster-editor/src/View/CharacterCard.elm +++ b/src/roster-editor/src/View/CharacterCard.elm @@ -192,9 +192,7 @@ get_weapon_details omnimods damage_multiplier weapon = [ (Html.Attributes.class "character-card-weapon"), (Html.Attributes.class "clickable"), - (Html.Events.onClick - (Struct.Event.TabSelected Struct.UI.WeaponSelectionTab) - ) + (Html.Events.onClick (Struct.Event.ClickedOnWeapon True)) ] [ (get_weapon_field_header damage_multiplier weapon), @@ -220,9 +218,7 @@ get_weapon_summary damage_multiplier weapon = [ (Html.Attributes.class "character-card-weapon-summary"), (Html.Attributes.class "clickable"), - (Html.Events.onClick - (Struct.Event.TabSelected Struct.UI.WeaponSelectionTab) - ) + (Html.Events.onClick (Struct.Event.ClickedOnWeapon False)) ] [ (get_weapon_field_header damage_multiplier weapon) |