summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-24 00:01:27 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-05-24 00:01:27 +0200
commitb61d70864de7e4a39196e06aaa7630c445e322c0 (patch)
tree7946c4a845161cac248a560f7a60c945d5fd2407 /src/battle/src/View
parentfc09d979e4c753377131684b1100c250e89765ea (diff)
...
Diffstat (limited to 'src/battle/src/View')
-rw-r--r--src/battle/src/View/Controlled.elm72
-rw-r--r--src/battle/src/View/Controlled/CharacterCard.elm3
-rw-r--r--src/battle/src/View/Controlled/ManualControls.elm2
-rw-r--r--src/battle/src/View/MainMenu.elm2
-rw-r--r--src/battle/src/View/Map.elm4
-rw-r--r--src/battle/src/View/Map/Character.elm6
-rw-r--r--src/battle/src/View/MessageBoard.elm4
-rw-r--r--src/battle/src/View/SubMenu.elm26
8 files changed, 44 insertions, 75 deletions
diff --git a/src/battle/src/View/Controlled.elm b/src/battle/src/View/Controlled.elm
index fe730fb..0293770 100644
--- a/src/battle/src/View/Controlled.elm
+++ b/src/battle/src/View/Controlled.elm
@@ -6,7 +6,7 @@ import Html.Attributes
import Html.Events
-- Shared ----------------------------------------------------------------------
-import Util.Html
+import Shared.Util.Html
-- Local Module ----------------------------------------------------------------
import Struct.CharacterTurn
@@ -26,16 +26,31 @@ has_a_path char_turn =
Nothing -> False
+skill_button : Struct.CharacterTurn.Type -> (Html.Html Struct.Event.Type)
+skill_button char_turn =
+ (Html.button
+ [ (Html.Events.onClick Struct.Event.AttackRequest) ]
+ [
+ (Html.text
+ (
+ if (has_a_path char_turn)
+ then ("Go & Select Skill Target(s)")
+ else ("Select Skill Target(s)")
+ )
+ )
+ ]
+ )
+
attack_button : Struct.CharacterTurn.Type -> (Html.Html Struct.Event.Type)
attack_button char_turn =
(Html.button
- [ (Html.Events.onClick Struct.Event.AttackWithoutMovingRequest) ]
+ [ (Html.Events.onClick Struct.Event.AttackRequest) ]
[
(Html.text
(
if (has_a_path char_turn)
- then ("Go & Select Target")
- else ("Select Target")
+ then ("Go & Select Attack Target")
+ else ("Select Attack Target")
)
)
]
@@ -55,14 +70,14 @@ undo_button =
[ (Html.text "Undo") ]
)
-end_turn_button : String -> (Html.Html Struct.Event.Type)
-end_turn_button suffix =
+end_turn_button : (Html.Html Struct.Event.Type)
+end_turn_button =
(Html.button
[
(Html.Events.onClick Struct.Event.TurnEnded),
(Html.Attributes.class "end-turn-button")
]
- [ (Html.text ("End Turn" ++ suffix)) ]
+ [ (Html.text ("Confirm Turn")) ]
)
inventory_button : Bool -> (Html.Html Struct.Event.Type)
@@ -85,41 +100,22 @@ get_available_actions : (
(List (Html.Html Struct.Event.Type))
)
get_available_actions char_turn =
- case (Struct.CharacterTurn.get_state char_turn) of
- Struct.CharacterTurn.SelectedCharacter ->
+ if ((Struct.CharacterTurn.get_action char_turn) == Struct.CharacterTurn.None)
+ then
[
(attack_button char_turn),
+ (skill_button char_turn),
(inventory_button (has_a_path char_turn)),
- (end_turn_button " Doing Nothing"),
- (abort_button)
- ]
-
- Struct.CharacterTurn.MovedCharacter ->
- [
- (inventory_button False),
- (end_turn_button " by Moving"),
- (undo_button),
- (abort_button)
- ]
-
- Struct.CharacterTurn.ChoseTarget ->
- [
- (end_turn_button " by Attacking"),
- (undo_button),
+ (end_turn_button),
(abort_button)
]
-
- Struct.CharacterTurn.SwitchedWeapons ->
+ else
[
- (end_turn_button " by Switching Weapons"),
+ (end_turn_button),
(undo_button),
(abort_button)
]
- _ ->
- [
- ]
-
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
@@ -140,14 +136,12 @@ get_html char_turn player_ix =
(
if
(
- (Struct.CharacterTurn.get_state char_turn)
+ (Struct.CharacterTurn.get_action char_turn)
==
- Struct.CharacterTurn.SelectedCharacter
+ Struct.CharacterTurn.None
)
- then
- (View.Controlled.ManualControls.get_html)
- else
- (Util.Html.nothing)
+ then (View.Controlled.ManualControls.get_html)
+ else (Shared.Util.Html.nothing)
),
(Html.div
[(Html.Attributes.class "controlled-actions")]
@@ -156,4 +150,4 @@ get_html char_turn player_ix =
]
)
- Nothing -> (Util.Html.nothing)
+ Nothing -> (Shared.Util.Html.nothing)
diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm
index 45e58d9..1981779 100644
--- a/src/battle/src/View/Controlled/CharacterCard.elm
+++ b/src/battle/src/View/Controlled/CharacterCard.elm
@@ -12,9 +12,6 @@ import Html
import Html.Attributes
import Html.Events
--- Shared ----------------------------------------------------------------------
-import Util.Html
-
-- Battle ----------------------------------------------------------------------
import Battle.Struct.DamageType
import Battle.Struct.Omnimods
diff --git a/src/battle/src/View/Controlled/ManualControls.elm b/src/battle/src/View/Controlled/ManualControls.elm
index d65bd1a..8c8c802 100644
--- a/src/battle/src/View/Controlled/ManualControls.elm
+++ b/src/battle/src/View/Controlled/ManualControls.elm
@@ -36,7 +36,7 @@ go_button =
(Html.button
[
(Html.Attributes.class "manual-controls-go"),
- (Html.Events.onClick Struct.Event.AttackWithoutMovingRequest)
+ (Html.Events.onClick Struct.Event.AttackRequest)
]
[
(Html.text "Go")
diff --git a/src/battle/src/View/MainMenu.elm b/src/battle/src/View/MainMenu.elm
index a40b2a3..318604c 100644
--- a/src/battle/src/View/MainMenu.elm
+++ b/src/battle/src/View/MainMenu.elm
@@ -16,7 +16,7 @@ get_menu_button_html : Struct.UI.Tab -> (Html.Html Struct.Event.Type)
get_menu_button_html tab =
(Html.button
[ (Html.Events.onClick (Struct.Event.TabSelected tab)) ]
- [ (Html.text (Struct.UI.to_string tab)) ]
+ [ (Html.text (Struct.UI.tab_to_string tab)) ]
)
get_main_menu_button_html : (Html.Html Struct.Event.Type)
diff --git a/src/battle/src/View/Map.elm b/src/battle/src/View/Map.elm
index babfcaf..5b0182e 100644
--- a/src/battle/src/View/Map.elm
+++ b/src/battle/src/View/Map.elm
@@ -10,7 +10,7 @@ import Html.Lazy
import List
-- Shared ----------------------------------------------------------------------
-import Util.Html
+import Shared.Util.Html
-- Battle Map ------------------------------------------------------------------
import BattleMap.Struct.Map
@@ -96,7 +96,7 @@ maybe_print_navigator interactive maybe_nav =
)
Nothing ->
- (Util.Html.nothing)
+ (Shared.Util.Html.nothing)
get_characters_html : (
Struct.Battle.Type ->
diff --git a/src/battle/src/View/Map/Character.elm b/src/battle/src/View/Map/Character.elm
index 1afffeb..49150eb 100644
--- a/src/battle/src/View/Map/Character.elm
+++ b/src/battle/src/View/Map/Character.elm
@@ -6,7 +6,7 @@ import Html.Attributes
import Html.Events
-- Shared ----------------------------------------------------------------------
-import Util.Html
+import Shared.Util.Html
-- Battle Characters -----------------------------------------------------------
import BattleCharacters.Struct.Portrait
@@ -80,7 +80,7 @@ get_head_html char =
get_banner_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
get_banner_html char =
-- TODO: Banner from some status indicator
- (Util.Html.nothing)
+ (Shared.Util.Html.nothing)
get_actual_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
get_actual_html char =
@@ -123,4 +123,4 @@ get_html : Struct.Character.Type -> (Html.Html Struct.Event.Type)
get_html char =
if (Struct.Character.is_alive char)
then (get_actual_html char)
- else (Util.Html.nothing)
+ else (Shared.Util.Html.nothing)
diff --git a/src/battle/src/View/MessageBoard.elm b/src/battle/src/View/MessageBoard.elm
index 77ceccf..7177d94 100644
--- a/src/battle/src/View/MessageBoard.elm
+++ b/src/battle/src/View/MessageBoard.elm
@@ -4,7 +4,7 @@ module View.MessageBoard exposing (get_html)
import Html
-- Shared ----------------------------------------------------------------------
-import Util.Html
+import Shared.Util.Html
-- Local Module ----------------------------------------------------------------
import Struct.Event
@@ -40,5 +40,5 @@ display model message =
get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type)
get_html model =
case (Struct.MessageBoard.maybe_get_current_message model.message_board) of
- Nothing -> (Util.Html.nothing)
+ Nothing -> (Shared.Util.Html.nothing)
(Just message) -> (display model message)
diff --git a/src/battle/src/View/SubMenu.elm b/src/battle/src/View/SubMenu.elm
index 0577cbf..1261764 100644
--- a/src/battle/src/View/SubMenu.elm
+++ b/src/battle/src/View/SubMenu.elm
@@ -8,11 +8,10 @@ import Html.Attributes
import Html.Lazy
-- Shared ----------------------------------------------------------------------
-import Util.Html
+import Shared.Util.Html
-- Local Module ----------------------------------------------------------------
import Struct.Battle
-import Struct.CharacterTurn
import Struct.Event
import Struct.Model
import Struct.UI
@@ -63,25 +62,4 @@ get_html model =
)
Nothing ->
- case (Struct.CharacterTurn.maybe_get_target model.char_turn) of
- (Just char_ref) ->
- 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)
- model.char_turn
- model.battle.own_player_ix
- char
- )
- ]
- )
-
- Nothing ->
- (Util.Html.nothing)
-
- Nothing ->
- (Util.Html.nothing)
+ (Shared.Util.Html.nothing)