| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'src/roster-editor')
| -rw-r--r-- | src/roster-editor/src/Comm/Send.elm | 2 | ||||
| -rw-r--r-- | src/roster-editor/src/Struct/ServerReply.elm | 1 | ||||
| -rw-r--r-- | src/roster-editor/src/Update/HandleServerReply.elm | 17 | 
3 files changed, 20 insertions, 0 deletions
| diff --git a/src/roster-editor/src/Comm/Send.elm b/src/roster-editor/src/Comm/Send.elm index a4cdf3b..c156a23 100644 --- a/src/roster-editor/src/Comm/Send.elm +++ b/src/roster-editor/src/Comm/Send.elm @@ -13,6 +13,7 @@ import Comm.AddGlyph  import Comm.AddGlyphBoard  import Comm.AddPortrait  import Comm.AddWeapon +import Comm.GoTo  import Comm.SetInventory  import Struct.Event @@ -40,6 +41,7 @@ internal_decoder reply_type =        "add_glyph_board" -> (Comm.AddGlyphBoard.decode)        "disconnected" -> (Json.Decode.succeed Struct.ServerReply.Disconnected) +      "goto" -> (Comm.GoTo.decode)        "okay" -> (Json.Decode.succeed Struct.ServerReply.Okay)        other -> diff --git a/src/roster-editor/src/Struct/ServerReply.elm b/src/roster-editor/src/Struct/ServerReply.elm index 1842ea4..50a7f09 100644 --- a/src/roster-editor/src/Struct/ServerReply.elm +++ b/src/roster-editor/src/Struct/ServerReply.elm @@ -18,6 +18,7 @@ import Struct.Weapon  type Type =     Okay     | Disconnected +   | GoTo String     | SetInventory Struct.Inventory.Type     | AddArmor Struct.Armor.Type     | AddGlyph Struct.Glyph.Type diff --git a/src/roster-editor/src/Update/HandleServerReply.elm b/src/roster-editor/src/Update/HandleServerReply.elm index 7392781..0836a76 100644 --- a/src/roster-editor/src/Update/HandleServerReply.elm +++ b/src/roster-editor/src/Update/HandleServerReply.elm @@ -84,6 +84,20 @@ disconnected current_state =           ]        ) +goto : ( +      String -> +      (Struct.Model.Type, (List (Cmd Struct.Event.Type))) -> +      (Struct.Model.Type, (List (Cmd Struct.Event.Type))) +   ) +goto url current_state = +   let (model, cmds) = current_state in +      ( +         model, +         [ +            (Action.Ports.go_to (Constants.IO.base_url ++ "/" ++ url)) +         ] +      ) +  add_armor : (        Struct.Armor.Type ->        (Struct.Model.Type, (List (Cmd Struct.Event.Type))) -> @@ -159,6 +173,8 @@ apply_command command current_state =     case command of        Struct.ServerReply.Disconnected -> (disconnected current_state) +      (Struct.ServerReply.GoTo url) -> (goto url current_state) +        (Struct.ServerReply.AddWeapon wp) ->           (add_weapon wp current_state) @@ -180,6 +196,7 @@ apply_command command current_state =        (Struct.ServerReply.AddCharacter char) ->           (add_character char current_state) +        Struct.ServerReply.Okay ->           let (model, cmds) = current_state in              ( | 


