summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-01-17 15:29:58 +0100 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-01-17 15:29:58 +0100 |
commit | 6eb4ee5739e2f9de7c24f232adbbdcf784d4cad3 (patch) | |
tree | cad458a24dc143e07a8d27298e7aefc1137a2ee9 /src/battle/src/View | |
parent | 816de590ed5656d6fef0a82eae8eb09fedd10b32 (diff) |
Moving battle module to Elm 0.19...
Diffstat (limited to 'src/battle/src/View')
-rw-r--r-- | src/battle/src/View/Character.elm | 14 | ||||
-rw-r--r-- | src/battle/src/View/Controlled/CharacterCard.elm | 19 | ||||
-rw-r--r-- | src/battle/src/View/Controlled/Targets.elm | 11 | ||||
-rw-r--r-- | src/battle/src/View/Gauge.elm | 6 | ||||
-rw-r--r-- | src/battle/src/View/Map.elm | 8 | ||||
-rw-r--r-- | src/battle/src/View/Map/Character.elm | 12 | ||||
-rw-r--r-- | src/battle/src/View/Map/Navigator.elm | 22 | ||||
-rw-r--r-- | src/battle/src/View/Map/Tile.elm | 14 | ||||
-rw-r--r-- | src/battle/src/View/MessageBoard/Animator/Attack.elm | 2 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Status/TileInfo.elm | 10 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/Attack.elm | 2 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/Movement.elm | 4 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/PlayerDefeat.elm | 2 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/PlayerTurnStart.elm | 2 | ||||
-rw-r--r-- | src/battle/src/View/SubMenu/Timeline/PlayerVictory.elm | 2 |
15 files changed, 82 insertions, 48 deletions
diff --git a/src/battle/src/View/Character.elm b/src/battle/src/View/Character.elm index d2b6a52..a22ca8a 100644 --- a/src/battle/src/View/Character.elm +++ b/src/battle/src/View/Character.elm @@ -55,8 +55,14 @@ get_position_style char = let char_loc = (Struct.Character.get_location char) in (Html.Attributes.style [ - ("top", ((toString (char_loc.y * Constants.UI.tile_size)) ++ "px")), - ("left", ((toString (char_loc.x * Constants.UI.tile_size)) ++ "px")) + ( + "top", + ((String.fromInt (char_loc.y * Constants.UI.tile_size)) ++ "px") + ), + ( + "left", + ((String.fromInt (char_loc.x * Constants.UI.tile_size)) ++ "px") + ) ] ) @@ -94,7 +100,7 @@ get_icon_body_html char = (Html.Attributes.class ( "asset-character-team-body-" - ++ (toString (Struct.Character.get_player_ix char)) + ++ (String.fromInt (Struct.Character.get_player_ix char)) ) ) ] @@ -204,7 +210,7 @@ get_portrait_html viewer_ix char = ( "character-portrait-team-" ++ - (toString (Struct.Character.get_player_ix char)) + (String.fromInt (Struct.Character.get_player_ix char)) ) ), (Html.Events.onClick diff --git a/src/battle/src/View/Controlled/CharacterCard.elm b/src/battle/src/View/Controlled/CharacterCard.elm index 08393c8..b659606 100644 --- a/src/battle/src/View/Controlled/CharacterCard.elm +++ b/src/battle/src/View/Controlled/CharacterCard.elm @@ -61,7 +61,7 @@ get_health_bar char = ) in (View.Gauge.get_html - ("HP: " ++ (toString current) ++ "/" ++ (toString max)) + ("HP: " ++ (String.fromInt current) ++ "/" ++ (String.fromInt max)) (100.0 * ((toFloat current)/(toFloat max))) [(Html.Attributes.class "character-card-health")] [] @@ -135,7 +135,7 @@ get_active_movement_bar maybe_navigator char = max in (View.Gauge.get_html - ("MP: " ++ (toString current) ++ "/" ++ (toString max)) + ("MP: " ++ (String.fromInt current) ++ "/" ++ (String.fromInt max)) (100.0 * ((toFloat current)/(toFloat max))) [(Html.Attributes.class "character-card-movement")] [] @@ -157,7 +157,7 @@ get_inactive_movement_bar char = ( "MP: " ++ - (toString + (String.fromInt (Struct.Statistics.get_movement_points (Struct.Character.get_statistics char) ) @@ -220,7 +220,7 @@ get_weapon_field_header damage_multiplier weapon = ( "~" ++ - (toString + (String.fromInt (ceiling ( (toFloat (Struct.Weapon.get_damage_sum weapon)) @@ -229,9 +229,10 @@ get_weapon_field_header damage_multiplier weapon = ) ) ++ " dmg @ [" - ++ (toString (Struct.Weapon.get_defense_range weapon)) + ++ + (String.fromInt (Struct.Weapon.get_defense_range weapon)) ++ ", " - ++ (toString (Struct.Weapon.get_attack_range weapon)) + ++ (String.fromInt (Struct.Weapon.get_attack_range weapon)) ++ "]" ) ) @@ -251,7 +252,7 @@ get_mod_html mod = ] [ (Html.text - (category ++ ": " ++ (toString value)) + (category ++ ": " ++ (String.fromInt value)) ) ] ) @@ -270,7 +271,7 @@ get_multiplied_mod_html multiplier mod = ( category ++ ": " - ++ (toString (ceiling ((toFloat value) * multiplier))) + ++ (String.fromInt (ceiling ((toFloat value) * multiplier))) ) ) ] @@ -367,7 +368,7 @@ stat_val val perc = [ (Html.text ( - (toString val) + (String.fromInt val) ++ ( if perc diff --git a/src/battle/src/View/Controlled/Targets.elm b/src/battle/src/View/Controlled/Targets.elm index 4b27175..c92d1d4 100644 --- a/src/battle/src/View/Controlled/Targets.elm +++ b/src/battle/src/View/Controlled/Targets.elm @@ -30,10 +30,10 @@ get_target_info_html model char_ref = "Attacking " ++ char.name ++ " (player " - ++ (toString (Struct.Character.get_player_ix char)) + ++ (String.fromInt (Struct.Character.get_player_ix char)) ++ "): " ++ - (toString + (String.fromInt (Struct.Statistics.get_movement_points (Struct.Character.get_statistics char) ) @@ -41,10 +41,13 @@ get_target_info_html model char_ref = ++ " movement points; " ++ "???" ++ " attack range. Health: " - ++ (toString (Struct.Character.get_sane_current_health char)) + ++ + (String.fromInt + (Struct.Character.get_sane_current_health char) + ) ++ "/" ++ - (toString + (String.fromInt (Struct.Statistics.get_max_health (Struct.Character.get_statistics char) ) diff --git a/src/battle/src/View/Gauge.elm b/src/battle/src/View/Gauge.elm index 2b9c4e0..a6bf09f 100644 --- a/src/battle/src/View/Gauge.elm +++ b/src/battle/src/View/Gauge.elm @@ -10,7 +10,7 @@ import Struct.Event -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -get_text_div: ( +get_text_div : ( String -> List (Html.Attribute Struct.Event.Type) -> (Html.Html Struct.Event.Type) @@ -26,7 +26,7 @@ get_text_div text extra_txt_attr = ] ) -get_bar_div: ( +get_bar_div : ( Float -> List (Html.Attribute Struct.Event.Type) -> (Html.Html Struct.Event.Type) @@ -37,7 +37,7 @@ get_bar_div percent extra_bar_attr = [ (Html.Attributes.style [ - ("width", ((toString percent) ++ "%")) + ("width", ((String.fromFloat percent) ++ "%")) ] ), (Html.Attributes.class diff --git a/src/battle/src/View/Map.elm b/src/battle/src/View/Map.elm index 12e9474..0e9a7fa 100644 --- a/src/battle/src/View/Map.elm +++ b/src/battle/src/View/Map.elm @@ -38,7 +38,7 @@ get_tiles_html map = ( "width", ( - (toString + (String.fromInt ( (Struct.Map.get_width map) * Constants.UI.tile_size @@ -50,7 +50,7 @@ get_tiles_html map = ( "height", ( - (toString + (String.fromInt ( (Struct.Map.get_height map) * Constants.UI.tile_size @@ -135,7 +135,9 @@ get_html model = ( "scale(" ++ - (toString (Struct.UI.get_zoom_level model.ui)) + (String.fromFloat + (Struct.UI.get_zoom_level model.ui) + ) ++ ")" ) ) diff --git a/src/battle/src/View/Map/Character.elm b/src/battle/src/View/Map/Character.elm index 4470b4a..6ced9f0 100644 --- a/src/battle/src/View/Map/Character.elm +++ b/src/battle/src/View/Map/Character.elm @@ -88,8 +88,14 @@ get_position_style char = let char_loc = (Struct.Character.get_location char) in (Html.Attributes.style [ - ("top", ((toString (char_loc.y * Constants.UI.tile_size)) ++ "px")), - ("left", ((toString (char_loc.x * Constants.UI.tile_size)) ++ "px")) + ( + "top", + ((String.fromInt (char_loc.y * Constants.UI.tile_size)) ++ "px") + ), + ( + "left", + ((String.fromInt (char_loc.x * Constants.UI.tile_size)) ++ "px") + ) ] ) @@ -127,7 +133,7 @@ get_body_html char = (Html.Attributes.class ( "asset-character-team-body-" - ++ (toString (Struct.Character.get_player_ix char)) + ++ (String.fromInt (Struct.Character.get_player_ix char)) ) ) ] diff --git a/src/battle/src/View/Map/Navigator.elm b/src/battle/src/View/Map/Navigator.elm index c4b430f..79dd3b0 100644 --- a/src/battle/src/View/Map/Navigator.elm +++ b/src/battle/src/View/Map/Navigator.elm @@ -56,11 +56,17 @@ marker_get_html is_interactive (loc_ref, marker) = [ ( "top", - ((toString (loc.y * Constants.UI.tile_size)) ++ "px") + ( + (String.fromInt (loc.y * Constants.UI.tile_size)) + ++ "px" + ) ), ( "left", - ((toString (loc.x * Constants.UI.tile_size)) ++ "px") + ( + (String.fromInt (loc.x * Constants.UI.tile_size)) + ++ "px" + ) ) ] ) @@ -151,7 +157,9 @@ path_node_get_html is_below_markers next_dir (curr_loc, curr_dir, curr_nodes) = ( "top", ( - (toString (curr_loc.y * Constants.UI.tile_size)) + (String.fromInt + (curr_loc.y * Constants.UI.tile_size) + ) ++ "px" ) @@ -159,7 +167,9 @@ path_node_get_html is_below_markers next_dir (curr_loc, curr_dir, curr_nodes) = ( "left", ( - (toString (curr_loc.x * Constants.UI.tile_size)) + (String.fromInt + (curr_loc.x * Constants.UI.tile_size) + ) ++ "px" ) @@ -200,11 +210,11 @@ mark_the_spot loc origin_dir = [ ( "top", - ((toString (loc.y * Constants.UI.tile_size)) ++ "px") + ((String.fromInt (loc.y * Constants.UI.tile_size)) ++ "px") ), ( "left", - ((toString (loc.x * Constants.UI.tile_size)) ++ "px") + ((String.fromInt (loc.x * Constants.UI.tile_size)) ++ "px") ) ] ) diff --git a/src/battle/src/View/Map/Tile.elm b/src/battle/src/View/Map/Tile.elm index 7bccf98..f2f3003 100644 --- a/src/battle/src/View/Map/Tile.elm +++ b/src/battle/src/View/Map/Tile.elm @@ -24,7 +24,7 @@ get_layer_html : ( get_layer_html index border = (Html.div [ - (Html.Attributes.class ("tile-icon-f-" ++ (toString index))), + (Html.Attributes.class ("tile-icon-f-" ++ (String.fromInt index))), (Html.Attributes.style [ ( @@ -110,7 +110,7 @@ get_html tile = (Html.Attributes.class ( "tile-variant-" - ++ (toString (Struct.Tile.get_local_variant_ix tile)) + ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile)) ) ), (Html.Attributes.class "clickable"), @@ -121,11 +121,17 @@ get_html tile = [ ( "top", - ((toString (tile_loc.y * Constants.UI.tile_size)) ++ "px") + ( + (String.fromInt (tile_loc.y * Constants.UI.tile_size)) + ++ "px" + ) ), ( "left", - ((toString (tile_loc.x * Constants.UI.tile_size)) ++ "px") + ( + (String.fromInt (tile_loc.x * Constants.UI.tile_size)) + ++ "px" + ) ) ] ) diff --git a/src/battle/src/View/MessageBoard/Animator/Attack.elm b/src/battle/src/View/MessageBoard/Animator/Attack.elm index 78c1f49..b715ac5 100644 --- a/src/battle/src/View/MessageBoard/Animator/Attack.elm +++ b/src/battle/src/View/MessageBoard/Animator/Attack.elm @@ -32,7 +32,7 @@ get_effect_text attack = "" else ( - ((toString attack.damage) ++ " damage") + ((String.fromInt attack.damage) ++ " damage") ++ ( if (attack.critical) diff --git a/src/battle/src/View/SubMenu/Status/TileInfo.elm b/src/battle/src/View/SubMenu/Status/TileInfo.elm index 1dbe8f6..bc382fc 100644 --- a/src/battle/src/View/SubMenu/Status/TileInfo.elm +++ b/src/battle/src/View/SubMenu/Status/TileInfo.elm @@ -32,7 +32,7 @@ get_icon tile = (Html.Attributes.class ( "tile-variant-" - ++ (toString (Struct.Tile.get_local_variant_ix tile)) + ++ (String.fromInt (Struct.Tile.get_local_variant_ix tile)) ) ) ] @@ -68,7 +68,7 @@ get_cost tile = then "Obstructed" else - ("Cost: " ++ (toString cost)) + ("Cost: " ++ (String.fromInt cost)) in (Html.div [ @@ -94,9 +94,9 @@ get_location tile = (Html.text ( "{x: " - ++ (toString tile_location.x) + ++ (String.fromInt tile_location.x) ++ "; y: " - ++ (toString tile_location.y) + ++ (String.fromInt tile_location.y) ++ "}" ) ) @@ -114,7 +114,7 @@ get_mod_html mod = ] [ (Html.text - (category ++ ": " ++ (toString value)) + (category ++ ": " ++ (String.fromInt value)) ) ] ) diff --git a/src/battle/src/View/SubMenu/Timeline/Attack.elm b/src/battle/src/View/SubMenu/Timeline/Attack.elm index 6ba8cd0..3eb3a04 100644 --- a/src/battle/src/View/SubMenu/Timeline/Attack.elm +++ b/src/battle/src/View/SubMenu/Timeline/Attack.elm @@ -56,7 +56,7 @@ get_effect_text attack = "" else ( - ((toString attack.damage) ++ " damage") + ((String.fromInt attack.damage) ++ " damage") ++ ( if (attack.critical) diff --git a/src/battle/src/View/SubMenu/Timeline/Movement.elm b/src/battle/src/View/SubMenu/Timeline/Movement.elm index e3be53d..028453c 100644 --- a/src/battle/src/View/SubMenu/Timeline/Movement.elm +++ b/src/battle/src/View/SubMenu/Timeline/Movement.elm @@ -41,9 +41,9 @@ get_html characters player_ix movement = ( (Struct.Character.get_name char) ++ " moved to (" - ++ (toString movement.destination.x) + ++ (String.fromInt movement.destination.x) ++ ", " - ++ (toString movement.destination.y) + ++ (String.fromInt movement.destination.y) ++ ")." ) ) diff --git a/src/battle/src/View/SubMenu/Timeline/PlayerDefeat.elm b/src/battle/src/View/SubMenu/Timeline/PlayerDefeat.elm index 1d91c9a..b2afd6e 100644 --- a/src/battle/src/View/SubMenu/Timeline/PlayerDefeat.elm +++ b/src/battle/src/View/SubMenu/Timeline/PlayerDefeat.elm @@ -30,7 +30,7 @@ get_html pdefeat = (Html.text ( "Player " - ++ (toString pdefeat.player_index) + ++ (String.fromInt pdefeat.player_index) ++ " has been eliminated." ) ) diff --git a/src/battle/src/View/SubMenu/Timeline/PlayerTurnStart.elm b/src/battle/src/View/SubMenu/Timeline/PlayerTurnStart.elm index 233e03c..1c4b829 100644 --- a/src/battle/src/View/SubMenu/Timeline/PlayerTurnStart.elm +++ b/src/battle/src/View/SubMenu/Timeline/PlayerTurnStart.elm @@ -30,7 +30,7 @@ get_html pturns = (Html.text ( "Player " - ++ (toString pturns.player_index) + ++ (String.fromInt pturns.player_index) ++ "'s turn has started." ) ) diff --git a/src/battle/src/View/SubMenu/Timeline/PlayerVictory.elm b/src/battle/src/View/SubMenu/Timeline/PlayerVictory.elm index 9728f04..9f166e4 100644 --- a/src/battle/src/View/SubMenu/Timeline/PlayerVictory.elm +++ b/src/battle/src/View/SubMenu/Timeline/PlayerVictory.elm @@ -30,7 +30,7 @@ get_html pvict = (Html.text ( "Player " - ++ (toString pvict.player_index) + ++ (String.fromInt pvict.player_index) ++ " has won the map." ) ) |