summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-05-26 23:54:28 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-05-26 23:54:28 +0200 |
commit | e625907e5846bba7f9fb66375700f35eb2c6be39 (patch) | |
tree | 6bea7f6af48c5affcdd474fb38d607b977fa598e /src/battle/src/View | |
parent | 333f924dcf232960d109a5d52ba1ecce9f78fde7 (diff) |
...
Diffstat (limited to 'src/battle/src/View')
-rw-r--r-- | src/battle/src/View/Character.elm | 4 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu.elm | 25 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/CharacterStatus.elm (renamed from src/battle/src/View/SubMenu/Status/CharacterInfo.elm) | 2 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Characters.elm | 4 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Status.elm | 62 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline.elm | 4 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/Attack.elm | 20 |
7 files changed, 42 insertions, 79 deletions
diff --git a/src/battle/src/View/Character.elm b/src/battle/src/View/Character.elm index 1b2d2e4..19acb83 100644 --- a/src/battle/src/View/Character.elm +++ b/src/battle/src/View/Character.elm @@ -28,7 +28,9 @@ get_portrait_html char = (BattleCharacters.View.Portrait.get_html ( (Html.Events.onClick - (Struct.Event.LookingForCharacter (Struct.Character.get_index char)) + (Struct.Event.CharacterCardSelected + (Struct.Character.get_index char) + ) ) :: (List.map diff --git a/src/battle/src/View/SubMenu.elm b/src/battle/src/View/SubMenu.elm index 1261764..d188f65 100644 --- a/src/battle/src/View/SubMenu.elm +++ b/src/battle/src/View/SubMenu.elm @@ -10,6 +10,9 @@ import Html.Lazy -- Shared ---------------------------------------------------------------------- import Shared.Util.Html +-- Battle Map ------------------------------------------------------------------ +import BattleMap.View.TileInfo + -- Local Module ---------------------------------------------------------------- import Struct.Battle import Struct.Event @@ -18,9 +21,9 @@ import Struct.UI import View.Controlled.CharacterCard +import View.SubMenu.CharacterStatus import View.SubMenu.Characters import View.SubMenu.Settings -import View.SubMenu.Status import View.SubMenu.Timeline -------------------------------------------------------------------------------- @@ -33,8 +36,24 @@ get_inner_html : ( ) get_inner_html model tab = case tab of - Struct.UI.StatusTab -> - (View.SubMenu.Status.get_html model) + (Struct.UI.TileStatusTab tile_loc) -> + (Html.Lazy.lazy3 + (BattleMap.View.TileInfo.get_html) + model.map_data_set + tile_loc + model.battle.map + ) + + (Struct.UI.CharacterStatusTab char_ref) -> + case (Struct.Battle.get_character char_ref model.battle) of + (Just char) -> + (Html.Lazy.lazy2 + (View.SubMenu.CharacterStatus.get_html) + model.battle.own_player_ix + char + ) + + _ -> (Html.text "Error: Unknown character selected.") Struct.UI.CharactersTab -> (Html.Lazy.lazy2 diff --git a/src/battle/src/View/SubMenu/Status/CharacterInfo.elm b/src/battle/src/View/SubMenu/CharacterStatus.elm index a8891e4..c1553aa 100644 --- a/src/battle/src/View/SubMenu/Status/CharacterInfo.elm +++ b/src/battle/src/View/SubMenu/CharacterStatus.elm @@ -1,4 +1,4 @@ -module View.SubMenu.Status.CharacterInfo exposing (get_html) +module View.SubMenu.CharacterStatus exposing (get_html) -- Elm ------------------------------------------------------------------------- import Html diff --git a/src/battle/src/View/SubMenu/Characters.elm b/src/battle/src/View/SubMenu/Characters.elm index 411e5e0..821940e 100644 --- a/src/battle/src/View/SubMenu/Characters.elm +++ b/src/battle/src/View/SubMenu/Characters.elm @@ -33,7 +33,9 @@ get_character_element_html player_ix char = (Html.Attributes.class "") ), (Html.Events.onClick - (Struct.Event.LookingForCharacter (Struct.Character.get_index char)) + (Struct.Event.CharacterCardSelected + (Struct.Character.get_index char) + ) ), ( if (Struct.Character.is_enabled char) diff --git a/src/battle/src/View/SubMenu/Status.elm b/src/battle/src/View/SubMenu/Status.elm deleted file mode 100644 index e351b34..0000000 --- a/src/battle/src/View/SubMenu/Status.elm +++ /dev/null @@ -1,62 +0,0 @@ -module View.SubMenu.Status exposing (get_html) - --- Elm ------------------------------------------------------------------------- -import Array - -import Html -import Html.Attributes -import Html.Lazy - --- Battle Map ------------------------------------------------------------------ -import BattleMap.Struct.Location - -import BattleMap.View.TileInfo - --- Local Module ---------------------------------------------------------------- -import Struct.Battle -import Struct.Event -import Struct.Model -import Struct.UI - -import View.SubMenu.Status.CharacterInfo - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type) -get_html model = - (Html.div - [ - (Html.Attributes.class "footer-tabmenu-content"), - (Html.Attributes.class "footer-tabmenu-content-status") - ] - [ - (case (Struct.UI.get_previous_action model.ui) of - (Just (Struct.UI.SelectedLocation loc)) -> - (Html.Lazy.lazy3 - (BattleMap.View.TileInfo.get_html) - model.map_data_set - loc - model.battle.map - ) - - (Just (Struct.UI.SelectedCharacter target_char)) -> - case (Struct.Battle.get_character target_char model.battle) of - (Just char) -> - (Html.Lazy.lazy2 - (View.SubMenu.Status.CharacterInfo.get_html) - model.battle.own_player_ix - char - ) - - _ -> (Html.text "Error: Unknown character selected.") - - _ -> - (Html.text "Nothing is being focused.") - ) - ] - ) diff --git a/src/battle/src/View/SubMenu/Timeline.elm b/src/battle/src/View/SubMenu/Timeline.elm index 18d6eca..2c1818e 100644 --- a/src/battle/src/View/SubMenu/Timeline.elm +++ b/src/battle/src/View/SubMenu/Timeline.elm @@ -7,6 +7,9 @@ import Html import Html.Attributes import Html.Lazy +-- Shared ---------------------------------------------------------------------- +import Shared.Util.Html + -- Local Module ---------------------------------------------------------------- import Struct.Battle import Struct.Character @@ -32,6 +35,7 @@ get_turn_result_html : ( ) get_turn_result_html characters player_ix turn_result = case turn_result of + (Struct.TurnResult.Targeted target) -> (Shared.Util.Html.nothing) (Struct.TurnResult.Moved movement) -> (View.SubMenu.Timeline.Movement.get_html characters diff --git a/src/battle/src/View/SubMenu/Timeline/Attack.elm b/src/battle/src/View/SubMenu/Timeline/Attack.elm index fe43b6a..9295951 100644 --- a/src/battle/src/View/SubMenu/Timeline/Attack.elm +++ b/src/battle/src/View/SubMenu/Timeline/Attack.elm @@ -151,18 +151,16 @@ get_html characters player_ix attack = (Html.Attributes.class "timeline-element"), (Html.Attributes.class "timeline-attack") ] - ( - [ - (View.Character.get_portrait_html atkchar), - (View.Character.get_portrait_html defchar), - (get_title_html atkchar defchar) - ] - ++ - (List.map - (get_attack_html atkchar defchar) - attack.sequence + [ + (View.Character.get_portrait_html atkchar), + (View.Character.get_portrait_html defchar), + (get_title_html atkchar defchar), + (get_attack_html + atkchar + defchar + (Struct.TurnResult.get_attack_data attack) ) - ) + ] ) _ -> |