From 944ce62360fe4c195b80d45ce529586cc78c6341 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 11 Jun 2018 18:25:04 +0200 Subject: Displayed nav goes away more easily. Also, I am trying to find nice ways to convey the "attack", "go to", and "can't defend" tiles, so that it look okay when superposing the navigator of the controlled character with the one of the focused character. --- src/asset/www/svg/redshield.svg | 164 ++++++++++++++++++++++++++++++++ src/battlemap/src/Struct/Model.elm | 5 +- src/battlemap/src/Update/SelectTile.elm | 36 ++++--- 3 files changed, 189 insertions(+), 16 deletions(-) create mode 100644 src/asset/www/svg/redshield.svg diff --git a/src/asset/www/svg/redshield.svg b/src/asset/www/svg/redshield.svg new file mode 100644 index 0000000..ad3679b --- /dev/null +++ b/src/asset/www/svg/redshield.svg @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/battlemap/src/Struct/Model.elm b/src/battlemap/src/Struct/Model.elm index e49ab1c..b954c68 100644 --- a/src/battlemap/src/Struct/Model.elm +++ b/src/battlemap/src/Struct/Model.elm @@ -99,7 +99,10 @@ reset characters model = {model | characters = characters, error = Nothing, - ui = (Struct.UI.set_previous_action Nothing model.ui), + ui = + (Struct.UI.reset_displayed_nav + (Struct.UI.set_previous_action Nothing model.ui) + ), char_turn = (Struct.CharacterTurn.new) } diff --git a/src/battlemap/src/Update/SelectTile.elm b/src/battlemap/src/Update/SelectTile.elm index fc6db27..7081d16 100644 --- a/src/battlemap/src/Update/SelectTile.elm +++ b/src/battlemap/src/Update/SelectTile.elm @@ -64,11 +64,13 @@ go_to_tile model navigator loc_ref = ( {model | ui = - (Struct.UI.set_displayed_tab - Struct.UI.StatusTab - (Struct.UI.set_previous_action - (Just (Struct.UI.SelectedLocation loc_ref)) - model.ui + (Struct.UI.reset_displayed_nav + (Struct.UI.set_displayed_tab + Struct.UI.StatusTab + (Struct.UI.set_previous_action + (Just (Struct.UI.SelectedLocation loc_ref)) + model.ui + ) ) ) }, @@ -99,11 +101,13 @@ go_to_tile model navigator loc_ref = model.char_turn ), ui = - (Struct.UI.set_displayed_tab - Struct.UI.StatusTab - (Struct.UI.set_previous_action - (Just (Struct.UI.SelectedLocation loc_ref)) - model.ui + (Struct.UI.reset_displayed_nav + (Struct.UI.set_displayed_tab + Struct.UI.StatusTab + (Struct.UI.set_previous_action + (Just (Struct.UI.SelectedLocation loc_ref)) + model.ui + ) ) ) }, @@ -142,11 +146,13 @@ apply_to model loc_ref = ( {model | ui = - (Struct.UI.set_displayed_tab - Struct.UI.StatusTab - (Struct.UI.set_previous_action - (Just (Struct.UI.SelectedLocation loc_ref)) - model.ui + (Struct.UI.reset_displayed_nav + (Struct.UI.set_displayed_tab + Struct.UI.StatusTab + (Struct.UI.set_previous_action + (Just (Struct.UI.SelectedLocation loc_ref)) + model.ui + ) ) ) }, -- cgit v1.2.3-70-g09d2