summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-06-19 21:01:59 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-06-19 21:01:59 +0200 |
commit | f0680b8d9f55bc0ac330377eca6c1d65b1a71bdf (patch) | |
tree | ef1f396e43492f8795ba002f9a08a381cc48403b | |
parent | c2cf27eb8d1570b67594cc802090218b50955ba3 (diff) |
Removes mdgriffith/elm-style-animation
I can afford to have my animations done through pure CSS, which is
likely preferable for the browser.
I'll try using andrewMacmurray/elm-delay next.
-rw-r--r-- | src/battlemap/elm-package.json | 3 | ||||
-rw-r--r-- | src/battlemap/src/ElmModule/Subscriptions.elm | 8 | ||||
-rw-r--r-- | src/battlemap/src/ElmModule/Update.elm | 4 | ||||
-rw-r--r-- | src/battlemap/src/Struct/Event.elm | 3 | ||||
-rw-r--r-- | src/battlemap/src/Struct/Model.elm | 7 | ||||
-rw-r--r-- | src/battlemap/src/Update/Animate.elm | 36 | ||||
-rw-r--r-- | src/battlemap/src/Update/TestAnimation.elm | 49 | ||||
-rw-r--r-- | src/battlemap/src/View/Battlemap/Character.elm | 44 |
8 files changed, 15 insertions, 139 deletions
diff --git a/src/battlemap/elm-package.json b/src/battlemap/elm-package.json index 78130fd..5f6573f 100644 --- a/src/battlemap/elm-package.json +++ b/src/battlemap/elm-package.json @@ -12,8 +12,7 @@ "elm-lang/core": "5.1.1 <= v < 6.0.0", "elm-lang/dom": "1.1.1 <= v < 2.0.0", "elm-lang/html": "2.0.0 <= v < 3.0.0", - "elm-lang/http": "1.0.0 <= v < 2.0.0", - "mdgriffith/elm-style-animation": "3.5.5 <= v < 4.0.0" + "elm-lang/http": "1.0.0 <= v < 2.0.0" }, "elm-version": "0.18.0 <= v < 0.19.0" } diff --git a/src/battlemap/src/ElmModule/Subscriptions.elm b/src/battlemap/src/ElmModule/Subscriptions.elm index 29a94c7..f342b30 100644 --- a/src/battlemap/src/ElmModule/Subscriptions.elm +++ b/src/battlemap/src/ElmModule/Subscriptions.elm @@ -1,7 +1,6 @@ module ElmModule.Subscriptions exposing (..) -- Elm ------------------------------------------------------------------------- -import Animation -- Battlemap ------------------------------------------------------------------- import Struct.Model @@ -15,9 +14,4 @@ import Struct.Event -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- subscriptions : Struct.Model.Type -> (Sub Struct.Event.Type) -subscriptions model = - case model.animation of - (Just animation) -> - (Animation.subscription Struct.Event.Animate [animation]) - - Nothing -> Sub.none +subscriptions model = Sub.none diff --git a/src/battlemap/src/ElmModule/Update.elm b/src/battlemap/src/ElmModule/Update.elm index bb1d973..7a81439 100644 --- a/src/battlemap/src/ElmModule/Update.elm +++ b/src/battlemap/src/ElmModule/Update.elm @@ -7,7 +7,6 @@ import Struct.Event import Struct.Model import Update.AbortTurn -import Update.Animate import Update.AttackWithoutMoving import Update.ChangeScale import Update.DisplayCharacterInfo @@ -91,8 +90,5 @@ update event model = Struct.Event.WeaponSwitchRequest -> (Update.SwitchWeapon.apply_to new_model) - (Struct.Event.Animate anim_msg) -> - (Update.Animate.apply_to model anim_msg) - Struct.Event.AbortTurnRequest -> (Update.AbortTurn.apply_to new_model) diff --git a/src/battlemap/src/Struct/Event.elm b/src/battlemap/src/Struct/Event.elm index 9eb1171..fbcdf1f 100644 --- a/src/battlemap/src/Struct/Event.elm +++ b/src/battlemap/src/Struct/Event.elm @@ -1,8 +1,6 @@ module Struct.Event exposing (Type(..), attempted) -- Elm ------------------------------------------------------------------------- -import Animation - import Http -- Battlemap ------------------------------------------------------------------- @@ -32,7 +30,6 @@ type Type = | TabSelected Struct.UI.Tab | TileSelected Struct.Location.Ref | TurnEnded - | Animate Animation.Msg | WeaponSwitchRequest attempted : (Result.Result err val) -> Type diff --git a/src/battlemap/src/Struct/Model.elm b/src/battlemap/src/Struct/Model.elm index 26eb7f2..b0752d9 100644 --- a/src/battlemap/src/Struct/Model.elm +++ b/src/battlemap/src/Struct/Model.elm @@ -15,8 +15,6 @@ module Struct.Model exposing ) -- Elm ------------------------------------------------------------------------- -import Animation - import Array import Dict @@ -27,7 +25,6 @@ import Struct.Battlemap import Struct.Character import Struct.CharacterTurn import Struct.Error -import Struct.Event import Struct.Tile import Struct.TurnResult import Struct.UI @@ -40,7 +37,6 @@ import Util.Array -------------------------------------------------------------------------------- type alias Type = { - animation: (Maybe Animation.State), battlemap: Struct.Battlemap.Type, characters: (Array.Array Struct.Character.Type), weapons: (Dict.Dict Struct.Weapon.Ref Struct.Weapon.Type), @@ -63,7 +59,6 @@ type alias Type = new : Type new = { - animation = Nothing, battlemap = (Struct.Battlemap.empty), characters = (Array.empty), weapons = (Dict.empty), @@ -122,7 +117,6 @@ add_tile tl model = reset : Type -> Type reset model = {model | - animation = Nothing, error = Nothing, ui = (Struct.UI.reset_displayed_nav @@ -134,7 +128,6 @@ reset model = full_debug_reset : Type -> Type full_debug_reset model = {model | - animation = Nothing, battlemap = (Struct.Battlemap.empty), characters = (Array.empty), weapons = (Dict.empty), diff --git a/src/battlemap/src/Update/Animate.elm b/src/battlemap/src/Update/Animate.elm deleted file mode 100644 index 30c6b8e..0000000 --- a/src/battlemap/src/Update/Animate.elm +++ /dev/null @@ -1,36 +0,0 @@ -module Update.Animate exposing (apply_to) - --- Elm ------------------------------------------------------------------------- -import Animation - --- Battlemap ------------------------------------------------------------------- -import Struct.Model -import Struct.Event - -type alias AnimationType = (Animation.State) --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -apply_to : ( - Struct.Model.Type -> - Animation.Msg -> - (Struct.Model.Type, (Cmd Struct.Event.Type)) - ) -apply_to model anim_msg = - ( - ( - case model.animation of - (Just curr_anim) -> - {model | - animation = (Just (Animation.update anim_msg curr_anim)) - } - - Nothing -> - model - ), - Cmd.none - ) diff --git a/src/battlemap/src/Update/TestAnimation.elm b/src/battlemap/src/Update/TestAnimation.elm index c36284f..fa7cb65 100644 --- a/src/battlemap/src/Update/TestAnimation.elm +++ b/src/battlemap/src/Update/TestAnimation.elm @@ -1,55 +1,14 @@ module Update.TestAnimation exposing (apply_to) -- Elm ------------------------------------------------------------------------- -import Animation -- Battlemap ------------------------------------------------------------------- import Struct.Model import Struct.Event -type alias AnimationType = (Animation.State) -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -no_animation : AnimationType -no_animation = - (Animation.style - [ - (Animation.translate (Animation.percent 0.0) (Animation.percent 0.0)) - ] - ) - -queue_go_up : AnimationType -> AnimationType -queue_go_up current_animation = - (Animation.queue - [ - (Animation.to - [ - (Animation.translate - (Animation.percent 0.0) - (Animation.percent 100.0) - ) - ] - ) - ] - current_animation - ) - -queue_go_right : AnimationType -> AnimationType -queue_go_right current_animation = - (Animation.queue - [ - (Animation.to - [ - (Animation.translate - (Animation.percent 100.0) - (Animation.percent 0.0) - ) - ] - ) - ] - current_animation - ) -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- @@ -58,10 +17,4 @@ apply_to : ( Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type)) ) -apply_to model = - ( - {model | - animation = (Just (queue_go_right (queue_go_up (no_animation)))) - }, - Cmd.none - ) +apply_to model = (model, Cmd.none) diff --git a/src/battlemap/src/View/Battlemap/Character.elm b/src/battlemap/src/View/Battlemap/Character.elm index f53d8de..a32ef5e 100644 --- a/src/battlemap/src/View/Battlemap/Character.elm +++ b/src/battlemap/src/View/Battlemap/Character.elm @@ -1,8 +1,6 @@ module View.Battlemap.Character exposing (get_html) -- Elm ------------------------------------------------------------------------- -import Animation - import Html import Html.Attributes import Html.Events @@ -120,38 +118,20 @@ get_actual_html : ( ) get_actual_html model char = (Html.div - ( - [ - (Html.Attributes.class "battlemap-tiled"), - (Html.Attributes.class "battlemap-character-icon"), - (get_activation_level_class char), - (get_alliance_class model char), - (get_position_style char), - (get_focus_class model char), - (Html.Attributes.class "clickable"), - (Html.Events.onClick - (Struct.Event.CharacterSelected - (Struct.Character.get_index char) - ) - ) - ] - ++ - ( - if - ( - (Struct.UI.get_previous_action model.ui) - == - (Just (Struct.UI.SelectedCharacter (Struct.Character.get_index char))) + [ + (Html.Attributes.class "battlemap-tiled"), + (Html.Attributes.class "battlemap-character-icon"), + (get_activation_level_class char), + (get_alliance_class model char), + (get_position_style char), + (get_focus_class model char), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.CharacterSelected + (Struct.Character.get_index char) ) - then - (case model.animation of - (Just animation) -> (Animation.render animation) - Nothing -> [] - ) - else - [] ) - ) + ] [ (get_body_html char), (get_head_html char) |