| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'src/map-editor/src/View')
| -rw-r--r-- | src/map-editor/src/View/Map.elm | 2 | ||||
| -rw-r--r-- | src/map-editor/src/View/Map/Tile.elm | 16 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu.elm | 4 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu/Status.elm | 40 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu/Status/CharacterInfo.elm | 34 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu/Status/TileInfo.elm | 134 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu/TileStatus.elm | 208 | ||||
| -rw-r--r-- | src/map-editor/src/View/SubMenu/Tiles.elm | 6 | ||||
| -rw-r--r-- | src/map-editor/src/View/Toolbox.elm | 6 | 
9 files changed, 225 insertions, 225 deletions
| diff --git a/src/map-editor/src/View/Map.elm b/src/map-editor/src/View/Map.elm index d98c088..a022850 100644 --- a/src/map-editor/src/View/Map.elm +++ b/src/map-editor/src/View/Map.elm @@ -31,7 +31,7 @@ get_tiles_html : (  get_tiles_html tb map =     (Html.div        [ -         (Html.Attributes.class "map-tiles-layer"), +         (Html.Attributes.class "tiles-layer"),           (Html.Attributes.style              "width"              ( diff --git a/src/map-editor/src/View/Map/Tile.elm b/src/map-editor/src/View/Map/Tile.elm index b5e3505..96fdee6 100644 --- a/src/map-editor/src/View/Map/Tile.elm +++ b/src/map-editor/src/View/Map/Tile.elm @@ -26,7 +26,7 @@ get_layer_html index border =     (Html.div        [           (Html.Attributes.class -            ("map-tile-icon-f-" ++ (String.fromInt index)) +            ("tile-icon-f-" ++ (String.fromInt index))           ),           (Html.Attributes.style              "background-image" @@ -54,7 +54,7 @@ get_content_html tile =     (        (Html.div           [ -            (Html.Attributes.class "map-tile-icon-bg"), +            (Html.Attributes.class "tile-icon-bg"),              (Html.Attributes.style                 "background-image"                 ( @@ -71,7 +71,7 @@ get_content_html tile =        (           (Html.div              [ -               (Html.Attributes.class "map-tile-icon-dt"), +               (Html.Attributes.class "tile-icon-dt"),                 (Html.Attributes.style                    "background-image"                    ( @@ -105,21 +105,21 @@ get_html tb tile =     in        (Html.div           [ -            (Html.Attributes.class "map-tile-icon"), -            (Html.Attributes.class "map-tiled"), +            (Html.Attributes.class "tile-icon"), +            (Html.Attributes.class "tiled"),              (                 if (Struct.Toolbox.is_selected tile_loc tb) -               then (Html.Attributes.class "map-tile-selected") +               then (Html.Attributes.class "tile-selected")                 else (Html.Attributes.class "")              ),              (                 if (Struct.Toolbox.is_square_corner tile_loc tb) -               then (Html.Attributes.class "map-tile-square-corner") +               then (Html.Attributes.class "tile-square-corner")                 else (Html.Attributes.class "")              ),              (Html.Attributes.class                 ( -                  "map-tile-variant-" +                  "tile-variant-"                    ++                    (String.fromInt                       (Struct.TileInstance.get_local_variant_ix tile) diff --git a/src/map-editor/src/View/SubMenu.elm b/src/map-editor/src/View/SubMenu.elm index 0b1fbea..70e66cf 100644 --- a/src/map-editor/src/View/SubMenu.elm +++ b/src/map-editor/src/View/SubMenu.elm @@ -13,7 +13,7 @@ import Util.Html  import View.SubMenu.Tiles  import View.SubMenu.Settings -import View.SubMenu.Status +import View.SubMenu.TileStatus  --------------------------------------------------------------------------------  -- LOCAL ----------------------------------------------------------------------- @@ -26,7 +26,7 @@ get_inner_html : (  get_inner_html model tab =     case tab of        Struct.UI.StatusTab -> -         (View.SubMenu.Status.get_html model) +         (View.SubMenu.TileStatus.get_html model)        Struct.UI.TilesTab ->           (View.SubMenu.Tiles.get_html model) diff --git a/src/map-editor/src/View/SubMenu/Status.elm b/src/map-editor/src/View/SubMenu/Status.elm deleted file mode 100644 index 69f5842..0000000 --- a/src/map-editor/src/View/SubMenu/Status.elm +++ /dev/null @@ -1,40 +0,0 @@ -module View.SubMenu.Status exposing (get_html) - --- Elm ------------------------------------------------------------------------- -import Html -import Html.Attributes - --- Struct.Battlemap ------------------------------------------------------------------- -import Struct.Event -import Struct.Location -import Struct.Model -import Struct.UI - -import View.SubMenu.Status.TileInfo --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type) -get_html model = -   (Html.div -      [ -         (Html.Attributes.class "tabmenu-content"), -         (Html.Attributes.class "tabmenu-content-status") -      ] -      [ -         (case (Struct.UI.get_previous_action model.ui) of -            (Just (Struct.UI.SelectedLocation loc)) -> -               (View.SubMenu.Status.TileInfo.get_html -                  model -                  (Struct.Location.from_ref loc) -               ) - -            _ -> -               (Html.text "Nothing is being focused.") -         ) -      ] -   ) diff --git a/src/map-editor/src/View/SubMenu/Status/CharacterInfo.elm b/src/map-editor/src/View/SubMenu/Status/CharacterInfo.elm deleted file mode 100644 index 6bfca87..0000000 --- a/src/map-editor/src/View/SubMenu/Status/CharacterInfo.elm +++ /dev/null @@ -1,34 +0,0 @@ -module View.SubMenu.Status.CharacterInfo exposing (get_html) - --- Elm ------------------------------------------------------------------------- -import Html -import Html.Attributes - --- Struct.Battlemap ------------------------------------------------------------------- -import Struct.Character -import Struct.Event - -import View.Controlled.CharacterCard - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_html : ( -      Int -> -      Struct.Character.Type -> -      (Html.Html Struct.Event.Type) -   ) -get_html player_ix char = -   (Html.div -      [ -         (Html.Attributes.class "tabmenu-character-info") -      ] -      [ -         (Html.text ("Focusing:")), -         (View.Controlled.CharacterCard.get_full_html player_ix char) -      ] -   ) diff --git a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm b/src/map-editor/src/View/SubMenu/Status/TileInfo.elm deleted file mode 100644 index 166dc42..0000000 --- a/src/map-editor/src/View/SubMenu/Status/TileInfo.elm +++ /dev/null @@ -1,134 +0,0 @@ -module View.SubMenu.Status.TileInfo exposing (get_html) - --- Elm ------------------------------------------------------------------------- -import Dict - -import Html -import Html.Attributes - --- Map Editor ------------------------------------------------------------------ -import Constants.Movement - -import Struct.Map -import Struct.Event -import Struct.Location -import Struct.Model -import Struct.Tile -import Struct.TileInstance - -import Util.Html - -import View.Map.Tile - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_icon : (Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)) -get_icon tile = -   (Html.div -      [ -         (Html.Attributes.class "map-tile-card-icon"), -         (Html.Attributes.class -            ( -               "map-tile-variant-" -               ++ -               (String.fromInt -                  (Struct.TileInstance.get_local_variant_ix tile) -               ) -            ) -         ) -      ] -      (View.Map.Tile.get_content_html tile) -   ) - -get_name : ( -      Struct.Model.Type -> -      Struct.TileInstance.Type -> -      (Html.Html Struct.Event.Type) -   ) -get_name model tile = -   case (Dict.get (Struct.TileInstance.get_class_id tile) model.tiles) of -      Nothing -> (Util.Html.nothing) -      (Just tile_type) -> -         (Html.div -            [ -               (Html.Attributes.class "map-tile-card-name") -            ] -            [ -               (Html.text (Struct.Tile.get_name tile_type)) -            ] -         ) - -get_cost : (Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)) -get_cost tile = -   let -      cost = (Struct.TileInstance.get_cost tile) -      text = -         if (cost > Constants.Movement.max_points) -         then -            "Obstructed" -         else -            ("Cost: " ++ (String.fromInt cost)) -   in -      (Html.div -         [ -            (Html.Attributes.class "map-tile-card-cost") -         ] -         [ -            (Html.text text) -         ] -      ) - -get_location : (Struct.TileInstance.Type -> (Html.Html Struct.Event.Type)) -get_location tile = -   let -      tile_location = (Struct.TileInstance.get_location tile) -   in -      (Html.div -         [ -            (Html.Attributes.class "map-tile-card-location") -         ] -         [ -            (Html.text -               ( -                  "{x: " -                  ++ (String.fromInt tile_location.x) -                  ++ "; y: " -                  ++ (String.fromInt tile_location.y) -                  ++ "}" -               ) -            ) -         ] -      ) - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -get_html : ( -      Struct.Model.Type -> -      Struct.Location.Type -> -      (Html.Html Struct.Event.Type) -   ) -get_html model loc = -   case (Struct.Map.try_getting_tile_at loc model.map) of -      (Just tile) -> -         (Html.div -            [ -               (Html.Attributes.class "map-tile-card") -            ] -            [ -               (get_name model tile), -               (Html.div -                  [ -                     (Html.Attributes.class "map-tile-card-top") -                  ] -                  [ -                     (get_icon tile), -                     (get_location tile), -                     (get_cost tile) -                  ] -               ) -            ] -         ) - -      Nothing -> (Html.text "Error: Unknown tile location selected.") diff --git a/src/map-editor/src/View/SubMenu/TileStatus.elm b/src/map-editor/src/View/SubMenu/TileStatus.elm new file mode 100644 index 0000000..0fd5031 --- /dev/null +++ b/src/map-editor/src/View/SubMenu/TileStatus.elm @@ -0,0 +1,208 @@ +module View.SubMenu.TileStatus exposing (get_html) + +-- Elm ------------------------------------------------------------------------- +import Dict + +import Html +import Html.Attributes + +-- Map Editor ------------------------------------------------------------------ +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 tile = +   (Html.div +      [ +         (Html.Attributes.class "tile-card-icon"), +         (Html.Attributes.class "info-card-picture"), +         (Html.Attributes.class +            ( +               "tile-variant-" +               ++ +               (String.fromInt +                  (Struct.TileInstance.get_local_variant_ix tile) +               ) +            ) +         ) +      ] +      (View.Map.Tile.get_content_html tile) +   ) + +get_name : ( +      Struct.Model.Type -> +      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 +      Nothing -> (Util.Html.nothing) +      (Just tile) -> +         (Html.div +            [ +               (Html.Attributes.class "info-card-name"), +               (Html.Attributes.class "info-card-text-field"), +               (Html.Attributes.class "tile-card-name") +            ] +            [ +               (Html.text (Struct.Tile.get_name tile)) +            ] +         ) + +get_cost : Struct.TileInstance.Type -> (Html.Html Struct.Event.Type) +get_cost tile_inst = +   let +      cost = (Struct.TileInstance.get_cost tile_inst) +      text = +         if (cost > Constants.Movement.max_points) +         then +            "Obstructed" +         else +            ("Cost: " ++ (String.fromInt cost)) +   in +      (Html.div +         [ +            (Html.Attributes.class "info-card-text-field"), +            (Html.Attributes.class "tile-card-cost") +         ] +         [ +            (Html.text text) +         ] +      ) + +get_location : Struct.TileInstance.Type -> (Html.Html Struct.Event.Type) +get_location tile_inst = +   let +      tile_location = (Struct.TileInstance.get_location tile_inst) +   in +      (Html.div +         [ +            (Html.Attributes.class "info-card-text-field"), +            (Html.Attributes.class "tile-card-location") +         ] +         [ +            (Html.text +               ( +                  "{x: " +                  ++ (String.fromInt tile_location.x) +                  ++ "; y: " +                  ++ (String.fromInt tile_location.y) +                  ++ "}" +               ) +            ) +         ] +      ) + +get_mod_html : (String, Int) -> (Html.Html Struct.Event.Type) +get_mod_html mod = +   let +      (category, value) = mod +   in +      (Html.div +         [ +            (Html.Attributes.class "info-card-mod") +         ] +         [ +            (Html.text +               (category ++ ": " ++ (String.fromInt value)) +            ) +         ] +      ) + +get_omnimods_listing : (List (String, Int)) -> (Html.Html Struct.Event.Type) +get_omnimods_listing mod_list = +   (Html.div +      [ +         (Html.Attributes.class "info-card-omnimods-listing") +      ] +      (List.map (get_mod_html) mod_list) +   ) + +get_omnimods : Struct.Omnimods.Type -> (Html.Html Struct.Event.Type) +get_omnimods omnimods = +   (Html.div +      [ +         (Html.Attributes.class "info-card-omnimods") +      ] +      [ +         (Html.text "Attribute Modifiers"), +         (get_omnimods_listing (Struct.Omnimods.get_attributes_mods omnimods)), +         (Html.text "Statistics Modifiers"), +         (get_omnimods_listing (Struct.Omnimods.get_statistics_mods omnimods)), +         (Html.text "Attack Modifiers"), +         (get_omnimods_listing (Struct.Omnimods.get_attack_mods omnimods)), +         (Html.text "Defense Modifiers"), +         (get_omnimods_listing (Struct.Omnimods.get_defense_mods omnimods)) +      ] +   ) + +get_tile_info_html : ( +      Struct.Model.Type -> +      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 +      (Just tile) -> +         (Html.div +            [ +               (Html.Attributes.class "info-card"), +               (Html.Attributes.class "tile-card") +            ] +            [ +               (get_name model tile), +               (Html.div +                  [ +                     (Html.Attributes.class "info-card-top"), +                     (Html.Attributes.class "tile-card-top") +                  ] +                  [ +                     (get_icon tile), +                     (get_location tile), +                     (get_cost tile) +                  ] +               ), +               (get_omnimods ((Struct.Model.tile_omnimods_fun model) loc)) +            ] +         ) + +      Nothing -> (Html.text "Error: Unknown tile location selected.") + +-------------------------------------------------------------------------------- +-- EXPORTED -------------------------------------------------------------------- +-------------------------------------------------------------------------------- +get_html : Struct.Model.Type -> (Html.Html Struct.Event.Type) +get_html model = +   (Html.div +      [ +         (Html.Attributes.class "tabmenu-content"), +         (Html.Attributes.class "tabmenu-content-status") +      ] +      [ +         (case (Struct.UI.get_previous_action model.ui) of +            (Just (Struct.UI.SelectedLocation loc)) -> +               (get_tile_info_html +                  model +                  (Struct.Location.from_ref loc) +               ) + +            _ -> +               (Html.text "Nothing is being focused.") +         ) +      ] +   ) diff --git a/src/map-editor/src/View/SubMenu/Tiles.elm b/src/map-editor/src/View/SubMenu/Tiles.elm index 5ef324f..511980d 100644 --- a/src/map-editor/src/View/SubMenu/Tiles.elm +++ b/src/map-editor/src/View/SubMenu/Tiles.elm @@ -25,10 +25,10 @@ get_icon_html : (  get_icon_html (ref, tile) =     (Html.div        [ -         (Html.Attributes.class "map-tile"), -         (Html.Attributes.class "map-tiled"), +         (Html.Attributes.class "tile"), +         (Html.Attributes.class "tiled"),           (Html.Attributes.class "clickable"), -         (Html.Attributes.class "map-tile-variant-0"), +         (Html.Attributes.class "tile-variant-0"),           (Html.Events.onClick              (Struct.Event.TemplateRequested ((Struct.Tile.get_id tile), "0"))           ) diff --git a/src/map-editor/src/View/Toolbox.elm b/src/map-editor/src/View/Toolbox.elm index a5ab910..442d01b 100644 --- a/src/map-editor/src/View/Toolbox.elm +++ b/src/map-editor/src/View/Toolbox.elm @@ -28,9 +28,9 @@ get_template_icon_html template =     (Html.div        [           (Html.Attributes.class "toolbox-template"), -         (Html.Attributes.class "map-tiled"), -         (Html.Attributes.class "map-tile"), -         (Html.Attributes.class "map-tile-variant-0") +         (Html.Attributes.class "tiled"), +         (Html.Attributes.class "tile"), +         (Html.Attributes.class "tile-variant-0")        ]        (View.Map.Tile.get_content_html template)     ) | 


