| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-04-16 14:50:58 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-04-16 14:50:58 +0200 | 
| commit | 25b3cae5f297c9fd9e5ea9e6368006f2d74a61c3 (patch) | |
| tree | f24e0306e2f8e17f5cff6c80fd0b4e934e654978 /src/battlemap | |
| parent | 4029aa799a5a3fcb392422f44ef2d08357fb128a (diff) | |
Adds a button for attack without moving.
Diffstat (limited to 'src/battlemap')
| -rw-r--r-- | src/battlemap/src/ElmModule/Update.elm | 4 | ||||
| -rw-r--r-- | src/battlemap/src/Struct/Event.elm | 1 | ||||
| -rw-r--r-- | src/battlemap/src/View/Footer.elm | 18 | ||||
| -rw-r--r-- | src/battlemap/www/style.css | 3 | 
4 files changed, 20 insertions, 6 deletions
| diff --git a/src/battlemap/src/ElmModule/Update.elm b/src/battlemap/src/ElmModule/Update.elm index 22217bf..36270a4 100644 --- a/src/battlemap/src/ElmModule/Update.elm +++ b/src/battlemap/src/ElmModule/Update.elm @@ -6,6 +6,7 @@ module ElmModule.Update exposing (update)  import Struct.Event  import Struct.Model +import Update.AttackWithoutMoving  import Update.ChangeScale  import Update.DisplayCharacterInfo  import Update.EndTurn @@ -28,6 +29,9 @@ update event model =        new_model = (Struct.Model.clear_error model)     in     case event of +      Struct.Event.AttackWithoutMovingRequest -> +         (Update.AttackWithoutMoving.apply_to new_model) +        (Struct.Event.DirectionRequested d) ->           (Update.RequestDirection.apply_to new_model d) diff --git a/src/battlemap/src/Struct/Event.elm b/src/battlemap/src/Struct/Event.elm index ecda85b..c2696eb 100644 --- a/src/battlemap/src/Struct/Event.elm +++ b/src/battlemap/src/Struct/Event.elm @@ -25,3 +25,4 @@ type Type =     | DebugTeamSwitchRequest     | DebugLoadBattlemapRequest     | WeaponSwitchRequest +   | AttackWithoutMovingRequest diff --git a/src/battlemap/src/View/Footer.elm b/src/battlemap/src/View/Footer.elm index b868dd7..6a95aa9 100644 --- a/src/battlemap/src/View/Footer.elm +++ b/src/battlemap/src/View/Footer.elm @@ -18,6 +18,13 @@ import Util.Html  --------------------------------------------------------------------------------  -- LOCAL -----------------------------------------------------------------------  -------------------------------------------------------------------------------- +attack_button : (Html.Html Struct.Event.Type) +attack_button = +   (Html.button +      [ (Html.Events.onClick Struct.Event.AttackWithoutMovingRequest) ] +      [ (Html.text "Attack Without Moving") ] +   ) +  end_turn_button : (Html.Html Struct.Event.Type)  end_turn_button =     (Html.button @@ -74,9 +81,11 @@ get_curr_char_info_htmls model char =                    ++ char.name                    ++ ". Move ("                    ++ (get_navigator_info model char) -                  ++ ") or " +                  ++ "), "                 )              ), +            (attack_button), +            (Html.text ", or "),              (inventory_button)           ] @@ -86,7 +95,7 @@ get_curr_char_info_htmls model char =                 (                    "Controlling "                    ++ char.name -                  ++ ". Moved. Select targets or " +                  ++ ". Moved. Select a target, or "                 )              ),              (end_turn_button) @@ -98,10 +107,11 @@ get_curr_char_info_htmls model char =                 (                    "Controlling "                    ++ char.name -                  ++ ". Moved. Chose target(s). Select additional targets or " +                  ++ ". Moved. Chose a target. Click on "                 )              ), -            (end_turn_button) +            (end_turn_button), +            (Html.text "to end turn.")           ]        _ -> diff --git a/src/battlemap/www/style.css b/src/battlemap/www/style.css index 0454862..8476f24 100644 --- a/src/battlemap/www/style.css +++ b/src/battlemap/www/style.css @@ -36,10 +36,10 @@     overflow-y: auto;     width: inherit;     word-wrap: break-word; -   padding-bottom: 1em;     border-top: 1px solid #502D16;     box-shadow: 0px -1px 2px #502D16;     padding: 0.5em; +   padding-bottom: 1em;  }  /*** Main View ****************************************************************/ @@ -148,7 +148,6 @@  .battlemap-characters-element  {     flex: 2; -   padding: 1em;     margin: 0.5em 0.5em 0 0.5em;     text-align: center;     background-color: #917C6f; | 


