summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-03-04 11:15:08 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-03-04 11:15:08 +0100
commitf6fbffbe6aac7e499db1db5a453b84885bb4b1db (patch)
treef2c94377dc4304d00d22f6f97a2c8de101d87e0f /src
parent64756704edf7e1ae2109cc3fc25fe1d62c629d11 (diff)
Oh, it compiles?
Diffstat (limited to 'src')
-rw-r--r--src/battle/src/ElmModule/Update.elm38
-rw-r--r--src/battle/src/Struct/Event.elm3
-rw-r--r--src/battle/src/View/SubMenu.elm14
-rw-r--r--src/battle/src/View/SubMenu/Settings.elm20
4 files changed, 23 insertions, 52 deletions
diff --git a/src/battle/src/ElmModule/Update.elm b/src/battle/src/ElmModule/Update.elm
index a6e1de5..77cdd89 100644
--- a/src/battle/src/ElmModule/Update.elm
+++ b/src/battle/src/ElmModule/Update.elm
@@ -35,68 +35,62 @@ update : (
(Struct.Model.Type, (Cmd Struct.Event.Type))
)
update event model =
- let
- new_model = (Struct.Model.clear_error model)
- in
case event of
Struct.Event.None -> (model, Cmd.none)
(Struct.Event.Failed err) ->
(
- (Struct.Model.invalidate err new_model),
+ (Struct.Model.invalidate err model),
Cmd.none
)
Struct.Event.AttackWithoutMovingRequest ->
- (Update.AttackWithoutMoving.apply_to new_model)
+ (Update.AttackWithoutMoving.apply_to model)
Struct.Event.AnimationEnded ->
(Update.Puppeteer.apply_to model)
(Struct.Event.DirectionRequested d) ->
- (Update.RequestDirection.apply_to new_model d)
+ (Update.RequestDirection.apply_to model d)
(Struct.Event.TileSelected loc) ->
- (Update.SelectTile.apply_to new_model loc)
+ (Update.SelectTile.apply_to model loc)
(Struct.Event.CharacterOrTileSelected loc) ->
- (Update.SelectCharacterOrTile.apply_to new_model loc)
+ (Update.SelectCharacterOrTile.apply_to model loc)
(Struct.Event.CharacterSelected char_id) ->
- (Update.SelectCharacter.apply_to new_model char_id)
+ (Update.SelectCharacter.apply_to model char_id)
(Struct.Event.CharacterInfoRequested char_id) ->
- (Update.DisplayCharacterInfo.apply_to new_model char_id)
+ (Update.DisplayCharacterInfo.apply_to model char_id)
(Struct.Event.LookingForCharacter char_id) ->
- (Update.LookForCharacter.apply_to new_model char_id)
+ (Update.LookForCharacter.apply_to model char_id)
Struct.Event.TurnEnded ->
- (Update.EndTurn.apply_to new_model)
+ (Update.EndTurn.apply_to model)
(Struct.Event.ScaleChangeRequested mod) ->
- (Update.ChangeScale.apply_to new_model mod)
+ (Update.ChangeScale.apply_to model mod)
(Struct.Event.TabSelected tab) ->
- (Update.SelectTab.apply_to new_model tab)
-
- Struct.Event.DebugTestAnimation ->
- (Update.TestAnimation.apply_to new_model)
+ (Update.SelectTab.apply_to model tab)
(Struct.Event.ServerReplied result) ->
(Update.HandleServerReply.apply_to model result)
Struct.Event.WeaponSwitchRequest ->
- (Update.SwitchWeapon.apply_to new_model)
+ (Update.SwitchWeapon.apply_to model)
Struct.Event.AbortTurnRequest ->
- (Update.AbortTurn.apply_to new_model)
+ (Update.AbortTurn.apply_to model)
Struct.Event.UndoActionRequest ->
- (Update.UndoAction.apply_to new_model)
+ (Update.UndoAction.apply_to model)
(Struct.Event.RequestedHelp help_request) ->
- (Update.SetRequestedHelp.apply_to new_model help_request)
+ (Update.SetRequestedHelp.apply_to model help_request)
Struct.Event.GoToMainMenu ->
- (Update.GoToMainMenu.apply_to new_model)
+ (Update.GoToMainMenu.apply_to model)
diff --git a/src/battle/src/Struct/Event.elm b/src/battle/src/Struct/Event.elm
index c03989f..2e6c5ff 100644
--- a/src/battle/src/Struct/Event.elm
+++ b/src/battle/src/Struct/Event.elm
@@ -23,9 +23,6 @@ type Type =
| CharacterInfoRequested Int
| CharacterOrTileSelected BattleMap.Struct.Location.Ref
| CharacterSelected Int
- | DebugLoadBattleRequest
- | DebugTeamSwitchRequest
- | DebugTestAnimation
| DirectionRequested BattleMap.Struct.Direction.Type
| Failed Struct.Error.Type
| GoToMainMenu
diff --git a/src/battle/src/View/SubMenu.elm b/src/battle/src/View/SubMenu.elm
index 5cb1b84..0577cbf 100644
--- a/src/battle/src/View/SubMenu.elm
+++ b/src/battle/src/View/SubMenu.elm
@@ -38,9 +38,10 @@ get_inner_html model tab =
(View.SubMenu.Status.get_html model)
Struct.UI.CharactersTab ->
- (Html.Lazy.lazy
+ (Html.Lazy.lazy2
(View.SubMenu.Characters.get_html)
- model.battle
+ model.battle.characters
+ model.battle.own_player_ix
)
Struct.UI.SettingsTab ->
@@ -64,19 +65,16 @@ get_html model =
Nothing ->
case (Struct.CharacterTurn.maybe_get_target model.char_turn) of
(Just char_ref) ->
- case (Array.get char_ref model.characters) of
+ case (Struct.Battle.get_character char_ref model.battle) of
(Just char) ->
(Html.div
[(Html.Attributes.class "sub-menu")]
[
(Html.text "Targeting:"),
(Html.Lazy.lazy3
- (View.Controlled.CharacterCard.get_summary_html
- (Struct.Battle.get_own_player_index
- model.battle
- )
- )
+ (View.Controlled.CharacterCard.get_summary_html)
model.char_turn
+ model.battle.own_player_ix
char
)
]
diff --git a/src/battle/src/View/SubMenu/Settings.elm b/src/battle/src/View/SubMenu/Settings.elm
index d214c7b..e14de91 100644
--- a/src/battle/src/View/SubMenu/Settings.elm
+++ b/src/battle/src/View/SubMenu/Settings.elm
@@ -36,24 +36,6 @@ get_html model =
[
(scale_button (0.75) "Zoom -"),
(scale_button 0 "Zoom Reset"),
- (scale_button (1.15) "Zoom +"),
- (Html.button
- [
- (Html.Events.onClick Struct.Event.DebugTeamSwitchRequest)
- ]
- [ (Html.text "[DEBUG] Switch team") ]
- ),
- (Html.button
- [
- (Html.Events.onClick Struct.Event.DebugLoadBattleRequest)
- ]
- [ (Html.text "[DEBUG] Load map") ]
- ),
- (Html.button
- [
- (Html.Events.onClick Struct.Event.DebugTestAnimation)
- ]
- [ (Html.text "[DEBUG] Test animations") ]
- )
+ (scale_button (1.15) "Zoom +")
]
)