summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/map-editor/src/View')
-rw-r--r--src/map-editor/src/View/MainMenu.elm2
-rw-r--r--src/map-editor/src/View/Map.elm18
-rw-r--r--src/map-editor/src/View/Map/Tile.elm54
-rw-r--r--src/map-editor/src/View/MessageBoard.elm2
-rw-r--r--src/map-editor/src/View/MessageBoard/Error.elm2
-rw-r--r--src/map-editor/src/View/MessageBoard/Help.elm2
-rw-r--r--src/map-editor/src/View/MessageBoard/Help/Guide.elm2
-rw-r--r--src/map-editor/src/View/SubMenu.elm7
-rw-r--r--src/map-editor/src/View/SubMenu/Markers.elm27
-rw-r--r--src/map-editor/src/View/SubMenu/Settings.elm2
-rw-r--r--src/map-editor/src/View/SubMenu/TileStatus.elm77
-rw-r--r--src/map-editor/src/View/SubMenu/Tiles.elm22
-rw-r--r--src/map-editor/src/View/Toolbox.elm19
13 files changed, 106 insertions, 130 deletions
diff --git a/src/map-editor/src/View/MainMenu.elm b/src/map-editor/src/View/MainMenu.elm
index 317250d..8a69aec 100644
--- a/src/map-editor/src/View/MainMenu.elm
+++ b/src/map-editor/src/View/MainMenu.elm
@@ -5,7 +5,7 @@ import Html
import Html.Attributes
import Html.Events
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.UI
diff --git a/src/map-editor/src/View/Map.elm b/src/map-editor/src/View/Map.elm
index a022850..0104669 100644
--- a/src/map-editor/src/View/Map.elm
+++ b/src/map-editor/src/View/Map.elm
@@ -9,23 +9,25 @@ import Html.Lazy
import List
--- Map Editor ------------------------------------------------------------------
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.Struct.Map
+
+-- Local Module ----------------------------------------------------------------
import Constants.UI
import Struct.Event
-import Struct.Map
import Struct.Model
import Struct.Toolbox
import Struct.UI
-import View.Map.Tile
+import View.SelectableTile
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
get_tiles_html : (
Struct.Toolbox.Type ->
- Struct.Map.Type ->
+ BattleMap.Struct.Map.Type ->
(Html.Html Struct.Event.Type)
)
get_tiles_html tb map =
@@ -37,7 +39,7 @@ get_tiles_html tb map =
(
(String.fromInt
(
- (Struct.Map.get_width map)
+ (BattleMap.Struct.Map.get_width map)
* Constants.UI.tile_size
)
)
@@ -49,7 +51,7 @@ get_tiles_html tb map =
(
(String.fromInt
(
- (Struct.Map.get_height map)
+ (BattleMap.Struct.Map.get_height map)
* Constants.UI.tile_size
)
)
@@ -58,8 +60,8 @@ get_tiles_html tb map =
)
]
(List.map
- (View.Map.Tile.get_html tb)
- (Array.toList (Struct.Map.get_tiles map))
+ (View.SelectableTile.get_html False tb)
+ (Array.toList (BattleMap.Struct.Map.get_tiles map))
)
)
diff --git a/src/map-editor/src/View/Map/Tile.elm b/src/map-editor/src/View/Map/Tile.elm
deleted file mode 100644
index 8fe96cf..0000000
--- a/src/map-editor/src/View/Map/Tile.elm
+++ /dev/null
@@ -1,54 +0,0 @@
-module View.Map.SelectableTile exposing (get_html)
-
--- Elm -------------------------------------------------------------------------
-import Html
-import Html.Attributes
-import Html.Events
-
--- Battle Map ------------------------------------------------------------------
-import Struct.TileInstance
-import Struct.Location
-
-import View.Map.Tile
-
--- Map Editor ------------------------------------------------------------------
-import Constants.UI
-import Constants.IO
-
-import Struct.Event
-import Struct.Toolbox
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-
-get_html : (
- Bool ->
- Struct.Toolbox.Type ->
- Struct.TileInstance.Type ->
- (Html.Html Struct.Event.Type)
- )
-get_html display_cost tb tile =
- let
- tile_loc = (Struct.TileInstance.get_location tile)
- in
- (View.Map.Tile.get_html_with_extra
- display_cost
- [
- (
- if (Struct.Toolbox.is_selected tile_loc tb)
- then (Html.Attributes.class "tile-selected")
- else (Html.Attributes.class "")
- ),
- (
- if (Struct.Toolbox.is_square_corner tile_loc tb)
- then (Html.Attributes.class "tile-square-corner")
- else (Html.Attributes.class "")
- )
- ]
- tile
- )
diff --git a/src/map-editor/src/View/MessageBoard.elm b/src/map-editor/src/View/MessageBoard.elm
index f1a2e9b..00859e7 100644
--- a/src/map-editor/src/View/MessageBoard.elm
+++ b/src/map-editor/src/View/MessageBoard.elm
@@ -3,7 +3,7 @@ module View.MessageBoard exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
diff --git a/src/map-editor/src/View/MessageBoard/Error.elm b/src/map-editor/src/View/MessageBoard/Error.elm
index 947586e..72de518 100644
--- a/src/map-editor/src/View/MessageBoard/Error.elm
+++ b/src/map-editor/src/View/MessageBoard/Error.elm
@@ -4,7 +4,7 @@ module View.MessageBoard.Error exposing (get_html)
import Html
import Html.Attributes
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Error
import Struct.Event
import Struct.Model
diff --git a/src/map-editor/src/View/MessageBoard/Help.elm b/src/map-editor/src/View/MessageBoard/Help.elm
index 3bc8f3c..eea0c8a 100644
--- a/src/map-editor/src/View/MessageBoard/Help.elm
+++ b/src/map-editor/src/View/MessageBoard/Help.elm
@@ -4,7 +4,7 @@ module View.MessageBoard.Help exposing (get_html)
import Html
import Html.Attributes
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.HelpRequest
import Struct.Model
diff --git a/src/map-editor/src/View/MessageBoard/Help/Guide.elm b/src/map-editor/src/View/MessageBoard/Help/Guide.elm
index 36d1e50..e4aff37 100644
--- a/src/map-editor/src/View/MessageBoard/Help/Guide.elm
+++ b/src/map-editor/src/View/MessageBoard/Help/Guide.elm
@@ -4,7 +4,7 @@ module View.MessageBoard.Help.Guide exposing (get_html_contents)
import Html
import Html.Attributes
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
diff --git a/src/map-editor/src/View/SubMenu.elm b/src/map-editor/src/View/SubMenu.elm
index 6e62ac5..7547e17 100644
--- a/src/map-editor/src/View/SubMenu.elm
+++ b/src/map-editor/src/View/SubMenu.elm
@@ -4,13 +4,14 @@ module View.SubMenu exposing (get_html)
import Html
import Html.Attributes
--- Map Editor ------------------------------------------------------------------
+-- Shared ----------------------------------------------------------------------
+import Util.Html
+
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
import Struct.UI
-import Util.Html
-
import View.SubMenu.Markers
import View.SubMenu.Settings
import View.SubMenu.TileStatus
diff --git a/src/map-editor/src/View/SubMenu/Markers.elm b/src/map-editor/src/View/SubMenu/Markers.elm
index f975eef..62aa89f 100644
--- a/src/map-editor/src/View/SubMenu/Markers.elm
+++ b/src/map-editor/src/View/SubMenu/Markers.elm
@@ -7,33 +7,30 @@ import Html
import Html.Attributes
import Html.Events
--- Map Editor ------------------------------------------------------------------
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.Struct.Tile
+import BattleMap.Struct.Map
+import BattleMap.Struct.Marker
+import BattleMap.Struct.TileInstance
+
+import BattleMap.View.Tile
+
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
-import Struct.Tile
-import Struct.TileInstance
-
-import View.Map.Tile
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
get_marker_html : (
- (String, Struct.MapMarker.Type)
+ (String, BattleMap.Struct.Marker.Type)
-> (Html.Html Struct.Event.Type)
)
get_marker_html (ref, marker) =
(Html.div
[
- (Html.Attributes.class "tile"),
- (Html.Attributes.class "tiled"),
- (Html.Attributes.class "clickable"),
- (Html.Attributes.class "tile-variant-0"),
- (Html.Events.onClick
- (Struct.Event.TemplateRequested ((Struct.Tile.get_id tile), "0"))
- )
]
- (View.Map.Tile.get_content_html (Struct.TileInstance.default tile))
+ [(Html.text ref)]
)
--------------------------------------------------------------------------------
@@ -48,6 +45,6 @@ get_html model =
]
(List.map
(get_marker_html)
- (Dict.toList (Struct.Map.get_markers model.map))
+ (Dict.toList (BattleMap.Struct.Map.get_markers model.map))
)
)
diff --git a/src/map-editor/src/View/SubMenu/Settings.elm b/src/map-editor/src/View/SubMenu/Settings.elm
index bd0561c..e14de91 100644
--- a/src/map-editor/src/View/SubMenu/Settings.elm
+++ b/src/map-editor/src/View/SubMenu/Settings.elm
@@ -5,7 +5,7 @@ import Html
import Html.Attributes
import Html.Events
--- Battlemap -------------------------------------------------------------------
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
diff --git a/src/map-editor/src/View/SubMenu/TileStatus.elm b/src/map-editor/src/View/SubMenu/TileStatus.elm
index 0fd5031..c1091ad 100644
--- a/src/map-editor/src/View/SubMenu/TileStatus.elm
+++ b/src/map-editor/src/View/SubMenu/TileStatus.elm
@@ -6,26 +6,31 @@ import Dict
import Html
import Html.Attributes
--- Map Editor ------------------------------------------------------------------
+-- Shared ----------------------------------------------------------------------
+import Util.Html
+
+-- Battle ----------------------------------------------------------------------
+import Battle.Struct.Omnimods
+
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.Struct.Location
+import BattleMap.Struct.Map
+import BattleMap.Struct.Tile
+import BattleMap.Struct.TileInstance
+
+import BattleMap.View.Tile
+
+-- Local Module ----------------------------------------------------------------
import Constants.Movement
import Struct.Event
-import Struct.Location
-import Struct.Map
import Struct.Model
-import Struct.Omnimods
-import Struct.Tile
-import Struct.TileInstance
import Struct.UI
-import Util.Html
-
-import View.Map.Tile
-
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
-get_icon : (Struct.TileInstance.Type -> (Html.Html Struct.Event.Type))
+get_icon : (BattleMap.Struct.TileInstance.Type -> (Html.Html Struct.Event.Type))
get_icon tile =
(Html.div
[
@@ -36,21 +41,26 @@ get_icon tile =
"tile-variant-"
++
(String.fromInt
- (Struct.TileInstance.get_local_variant_ix tile)
+ (BattleMap.Struct.TileInstance.get_local_variant_ix tile)
)
)
)
]
- (View.Map.Tile.get_content_html tile)
+ (BattleMap.View.Tile.get_content_html tile)
)
get_name : (
Struct.Model.Type ->
- Struct.TileInstance.Type ->
+ BattleMap.Struct.TileInstance.Type ->
(Html.Html Struct.Event.Type)
)
get_name model tile_inst =
- case (Dict.get (Struct.TileInstance.get_class_id tile_inst) model.tiles) of
+ case
+ (Dict.get
+ (BattleMap.Struct.TileInstance.get_class_id tile_inst)
+ model.tiles
+ )
+ of
Nothing -> (Util.Html.nothing)
(Just tile) ->
(Html.div
@@ -60,14 +70,14 @@ get_name model tile_inst =
(Html.Attributes.class "tile-card-name")
]
[
- (Html.text (Struct.Tile.get_name tile))
+ (Html.text (BattleMap.Struct.Tile.get_name tile))
]
)
-get_cost : Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)
+get_cost : BattleMap.Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)
get_cost tile_inst =
let
- cost = (Struct.TileInstance.get_cost tile_inst)
+ cost = (BattleMap.Struct.TileInstance.get_cost tile_inst)
text =
if (cost > Constants.Movement.max_points)
then
@@ -85,10 +95,13 @@ get_cost tile_inst =
]
)
-get_location : Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)
+get_location : (
+ BattleMap.Struct.TileInstance.Type ->
+ (Html.Html Struct.Event.Type)
+ )
get_location tile_inst =
let
- tile_location = (Struct.TileInstance.get_location tile_inst)
+ tile_location = (BattleMap.Struct.TileInstance.get_location tile_inst)
in
(Html.div
[
@@ -133,7 +146,7 @@ get_omnimods_listing mod_list =
(List.map (get_mod_html) mod_list)
)
-get_omnimods : Struct.Omnimods.Type -> (Html.Html Struct.Event.Type)
+get_omnimods : Battle.Struct.Omnimods.Type -> (Html.Html Struct.Event.Type)
get_omnimods omnimods =
(Html.div
[
@@ -141,23 +154,31 @@ get_omnimods omnimods =
]
[
(Html.text "Attribute Modifiers"),
- (get_omnimods_listing (Struct.Omnimods.get_attributes_mods omnimods)),
+ (get_omnimods_listing
+ (Battle.Struct.Omnimods.get_attributes_mods omnimods)
+ ),
(Html.text "Statistics Modifiers"),
- (get_omnimods_listing (Struct.Omnimods.get_statistics_mods omnimods)),
+ (get_omnimods_listing
+ (Battle.Struct.Omnimods.get_statistics_mods omnimods)
+ ),
(Html.text "Attack Modifiers"),
- (get_omnimods_listing (Struct.Omnimods.get_attack_mods omnimods)),
+ (get_omnimods_listing
+ (Battle.Struct.Omnimods.get_attack_mods omnimods)
+ ),
(Html.text "Defense Modifiers"),
- (get_omnimods_listing (Struct.Omnimods.get_defense_mods omnimods))
+ (get_omnimods_listing
+ (Battle.Struct.Omnimods.get_defense_mods omnimods)
+ )
]
)
get_tile_info_html : (
Struct.Model.Type ->
- Struct.Location.Type ->
+ BattleMap.Struct.Location.Type ->
(Html.Html Struct.Event.Type)
)
get_tile_info_html model loc =
- case (Struct.Map.try_getting_tile_at loc model.map) of
+ case (BattleMap.Struct.Map.try_getting_tile_at loc model.map) of
(Just tile) ->
(Html.div
[
@@ -198,7 +219,7 @@ get_html model =
(Just (Struct.UI.SelectedLocation loc)) ->
(get_tile_info_html
model
- (Struct.Location.from_ref loc)
+ (BattleMap.Struct.Location.from_ref loc)
)
_ ->
diff --git a/src/map-editor/src/View/SubMenu/Tiles.elm b/src/map-editor/src/View/SubMenu/Tiles.elm
index 511980d..16b147e 100644
--- a/src/map-editor/src/View/SubMenu/Tiles.elm
+++ b/src/map-editor/src/View/SubMenu/Tiles.elm
@@ -7,19 +7,21 @@ import Html
import Html.Attributes
import Html.Events
--- Map Editor ------------------------------------------------------------------
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.Struct.Tile
+import BattleMap.Struct.TileInstance
+
+import BattleMap.View.Tile
+
+-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.Model
-import Struct.Tile
-import Struct.TileInstance
-
-import View.Map.Tile
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
get_icon_html : (
- (Struct.Tile.Ref, Struct.Tile.Type) ->
+ (BattleMap.Struct.Tile.Ref, BattleMap.Struct.Tile.Type) ->
(Html.Html Struct.Event.Type)
)
get_icon_html (ref, tile) =
@@ -30,10 +32,14 @@ get_icon_html (ref, tile) =
(Html.Attributes.class "clickable"),
(Html.Attributes.class "tile-variant-0"),
(Html.Events.onClick
- (Struct.Event.TemplateRequested ((Struct.Tile.get_id tile), "0"))
+ (Struct.Event.TemplateRequested
+ ((BattleMap.Struct.Tile.get_id tile), "0")
+ )
)
]
- (View.Map.Tile.get_content_html (Struct.TileInstance.default tile))
+ (BattleMap.View.Tile.get_content_html
+ (BattleMap.Struct.TileInstance.default tile)
+ )
)
--------------------------------------------------------------------------------
diff --git a/src/map-editor/src/View/Toolbox.elm b/src/map-editor/src/View/Toolbox.elm
index 442d01b..c9711d4 100644
--- a/src/map-editor/src/View/Toolbox.elm
+++ b/src/map-editor/src/View/Toolbox.elm
@@ -7,21 +7,24 @@ import Html
import Html.Attributes
import Html.Events
--- Map Editor ------------------------------------------------------------------
+-- Battle Map ------------------------------------------------------------------
+import BattleMap.Struct.Map
+import BattleMap.Struct.Tile
+import BattleMap.Struct.TileInstance
+
+import BattleMap.View.Tile
+
+-- Local Module ----------------------------------------------------------------
import Struct.Event
-import Struct.Map
import Struct.Model
-import Struct.Tile
-import Struct.TileInstance
import Struct.Toolbox
-import View.Map.Tile
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
get_template_icon_html : (
- Struct.TileInstance.Type ->
+ BattleMap.Struct.TileInstance.Type ->
(Html.Html Struct.Event.Type)
)
get_template_icon_html template =
@@ -32,7 +35,7 @@ get_template_icon_html template =
(Html.Attributes.class "tile"),
(Html.Attributes.class "tile-variant-0")
]
- (View.Map.Tile.get_content_html template)
+ (BattleMap.View.Tile.get_content_html template)
)
get_mode_button : (
@@ -139,7 +142,7 @@ get_html model =
(get_template_icon_html (Struct.Toolbox.get_template tb)),
(get_modes_menu_html tb),
(get_shapes_menu_html tb),
- (get_markers_html (Dict.keys (Struct.Map.get_markers model.map))),
+ (get_markers_html (Dict.keys (BattleMap.Struct.Map.get_markers model.map))),
(get_others_menu_html)
]
)