summaryrefslogtreecommitdiff |
diff options
-rw-r--r-- | src/battlemap/src/ElmModule/Update.elm | 4 | ||||
-rw-r--r-- | src/battlemap/src/Struct/Event.elm | 1 | ||||
-rw-r--r-- | src/battlemap/src/Update/OpenInventory.elm | 30 | ||||
-rw-r--r-- | src/battlemap/src/Update/SelectCharacter.elm | 5 | ||||
-rw-r--r-- | src/battlemap/src/View/Battlemap/Character.elm | 1 | ||||
-rw-r--r-- | src/battlemap/src/View/Battlemap/Navigator.elm | 80 | ||||
-rw-r--r-- | src/battlemap/src/View/Battlemap/Tile.elm | 1 | ||||
-rw-r--r-- | src/battlemap/src/View/Footer.elm | 2 | ||||
-rw-r--r-- | src/battlemap/src/View/SideBar/TabMenu/Characters.elm | 5 | ||||
-rw-r--r-- | src/global/www/style.css | 6 |
10 files changed, 61 insertions, 74 deletions
diff --git a/src/battlemap/src/ElmModule/Update.elm b/src/battlemap/src/ElmModule/Update.elm index 188b2fc..c4cd301 100644 --- a/src/battlemap/src/ElmModule/Update.elm +++ b/src/battlemap/src/ElmModule/Update.elm @@ -11,7 +11,6 @@ import Struct.Model import Update.ChangeScale import Update.EndTurn import Update.HandleServerReply -import Update.OpenInventory import Update.RequestDirection import Update.SelectCharacter import Update.SelectTab @@ -57,6 +56,3 @@ update event model = (Struct.Event.ServerReplied result) -> (Update.HandleServerReply.apply_to model result) - - Struct.Event.InventoryRequested -> - (Update.OpenInventory.apply_to model) diff --git a/src/battlemap/src/Struct/Event.elm b/src/battlemap/src/Struct/Event.elm index ff6b62f..dadc11d 100644 --- a/src/battlemap/src/Struct/Event.elm +++ b/src/battlemap/src/Struct/Event.elm @@ -20,6 +20,5 @@ type Type = | ScaleChangeRequested Float | TabSelected Struct.UI.Tab | ServerReplied (Result Http.Error (List (List String))) - | InventoryRequested | DebugTeamSwitchRequest | DebugLoadBattlemapRequest diff --git a/src/battlemap/src/Update/OpenInventory.elm b/src/battlemap/src/Update/OpenInventory.elm deleted file mode 100644 index ff26f92..0000000 --- a/src/battlemap/src/Update/OpenInventory.elm +++ /dev/null @@ -1,30 +0,0 @@ -module Update.OpenInventory exposing (apply_to) --- Elm ------------------------------------------------------------------------- - --- Battlemap ------------------------------------------------------------------- -import Struct.Model -import Struct.Event -import Struct.Error - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -apply_to : ( - Struct.Model.Type -> - (Struct.Model.Type, (Cmd Struct.Event.Type)) - ) -apply_to model = - ( - (Struct.Model.invalidate - model - (Struct.Error.new - Struct.Error.Unimplemented - "Display Character Inventory" - ) - ), - Cmd.none - ) diff --git a/src/battlemap/src/Update/SelectCharacter.elm b/src/battlemap/src/Update/SelectCharacter.elm index fe5521c..5c14ef8 100644 --- a/src/battlemap/src/Update/SelectCharacter.elm +++ b/src/battlemap/src/Update/SelectCharacter.elm @@ -182,7 +182,10 @@ apply_to model target_char_id = {model | ui = (Struct.UI.set_previous_action - model.ui + (Struct.UI.set_displayed_tab + model.ui + Struct.UI.StatusTab + ) (Just (Struct.UI.SelectedCharacter target_char_id)) ) }, diff --git a/src/battlemap/src/View/Battlemap/Character.elm b/src/battlemap/src/View/Battlemap/Character.elm index 96641a3..714e0a5 100644 --- a/src/battlemap/src/View/Battlemap/Character.elm +++ b/src/battlemap/src/View/Battlemap/Character.elm @@ -45,6 +45,7 @@ get_html char = ++ (toString (Struct.Character.get_team char)) ) ), + (Html.Attributes.class "clickable"), (Html.Events.onClick (Struct.Event.CharacterSelected (Struct.Character.get_ref char)) ), diff --git a/src/battlemap/src/View/Battlemap/Navigator.elm b/src/battlemap/src/View/Battlemap/Navigator.elm index fc32cc0..28313e0 100644 --- a/src/battlemap/src/View/Battlemap/Navigator.elm +++ b/src/battlemap/src/View/Battlemap/Navigator.elm @@ -26,51 +26,57 @@ marker_get_html : ( ) marker_get_html is_interactive (loc_ref, marker) = (Html.div - [ - (Html.Attributes.class "battlemap-marker-icon"), - (Html.Attributes.class "battlemap-tiled"), - (Html.Attributes.class - ( - "battlemap-" - ++ + ( + [ + (Html.Attributes.class "battlemap-marker-icon"), + (Html.Attributes.class "battlemap-tiled"), + (Html.Attributes.class ( - if (marker == Struct.Marker.CanGoTo) - then - "can-go-to" - else - "can-attack" + "battlemap-" + ++ + ( + if (marker == Struct.Marker.CanGoTo) + then + "can-go-to" + else + "can-attack" + ) + ++ + "-marker" + ) + ), + (Html.Attributes.style + ( + let + loc = (Struct.Location.from_ref loc_ref) + in + [ + ( + "top", + ((toString (loc.y * Constants.UI.tile_size)) ++ "px") + ), + ( + "left", + ((toString (loc.x * Constants.UI.tile_size)) ++ "px") + ) + ] ) - ++ - "-marker" ) - ), + ] + ++ ( if (is_interactive && (marker == Struct.Marker.CanGoTo)) then - (Html.Events.onClick - (Struct.Event.TileSelected loc_ref) - ) + [ + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.TileSelected loc_ref) + ) + ] else - (Html.Attributes.class "") - ), - (Html.Attributes.style - ( - let - loc = (Struct.Location.from_ref loc_ref) - in - [ - ( - "top", - ((toString (loc.y * Constants.UI.tile_size)) ++ "px") - ), - ( - "left", - ((toString (loc.x * Constants.UI.tile_size)) ++ "px") - ) - ] - ) + [] ) - ] + ) [ ] ) diff --git a/src/battlemap/src/View/Battlemap/Tile.elm b/src/battlemap/src/View/Battlemap/Tile.elm index 376a442..332bcd0 100644 --- a/src/battlemap/src/View/Battlemap/Tile.elm +++ b/src/battlemap/src/View/Battlemap/Tile.elm @@ -34,6 +34,7 @@ get_html tile = (Html.Attributes.class ("asset-tile-" ++ (Struct.Tile.get_icon_id tile)) ), + (Html.Attributes.class "clickable"), (Html.Events.onClick (Struct.Event.TileSelected (Struct.Location.get_ref tile_loc)) ) diff --git a/src/battlemap/src/View/Footer.elm b/src/battlemap/src/View/Footer.elm index fd2e4a5..aa900dc 100644 --- a/src/battlemap/src/View/Footer.elm +++ b/src/battlemap/src/View/Footer.elm @@ -31,7 +31,7 @@ end_turn_button = inventory_button : (Html.Html Struct.Event.Type) inventory_button = (Html.button - [ (Html.Events.onClick Struct.Event.InventoryRequested) ] + [ ] [ (Html.text "Switch Weapon") ] ) diff --git a/src/battlemap/src/View/SideBar/TabMenu/Characters.elm b/src/battlemap/src/View/SideBar/TabMenu/Characters.elm index 2907988..cadf81e 100644 --- a/src/battlemap/src/View/SideBar/TabMenu/Characters.elm +++ b/src/battlemap/src/View/SideBar/TabMenu/Characters.elm @@ -5,6 +5,7 @@ import Dict import Html import Html.Attributes +import Html.Events -- Battlemap ------------------------------------------------------------------- import Struct.Character @@ -27,6 +28,10 @@ get_character_portrait_html char = "asset-character-portrait-" ++ (Struct.Character.get_portrait_id char) ) + ), + (Html.Attributes.class "clickable"), + (Html.Events.onClick + (Struct.Event.CharacterSelected (Struct.Character.get_ref char)) ) ] [ diff --git a/src/global/www/style.css b/src/global/www/style.css index 9bffa0b..cd083b4 100644 --- a/src/global/www/style.css +++ b/src/global/www/style.css @@ -16,3 +16,9 @@ html, body, .fullscreen-module padding: 0; display: flex; } + +.clickable +{ + cursor: pointer; + touch-action: manipulation; +} |