blob: 032a002f53a026c82ed146adc11a8885e0ddb068 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
module Struct.Event exposing (Type(..), attempted)
-- Elm -------------------------------------------------------------------------
import Http
-- Roster Editor ---------------------------------------------------------------
import Struct.Armor
import Struct.Error
import Struct.Glyph
import Struct.GlyphBoard
import Struct.HelpRequest
import Struct.Portrait
import Struct.ServerReply
import Struct.UI
import Struct.Weapon
--------------------------------------------------------------------------------
-- TYPES -----------------------------------------------------------------------
--------------------------------------------------------------------------------
type Type =
None
| CharacterSelected Int
| ToggleCharacterBattleIndex Int
| Failed Struct.Error.Type
| GoToMainMenu
| RequestedHelp Struct.HelpRequest.Type
| ServerReplied (Result Http.Error (List Struct.ServerReply.Type))
| TabSelected Struct.UI.Tab
| ClickedOnWeapon Bool
| ClickedOnGlyph Int
| SaveRequest
| GoRequest
| SetCharacterName String
| SelectedArmor Struct.Armor.Ref
| SelectedGlyph Struct.Glyph.Ref
| SelectedGlyphBoard Struct.GlyphBoard.Ref
| SelectedPortrait Struct.Portrait.Ref
| SelectedWeapon Struct.Weapon.Ref
attempted : (Result.Result err val) -> Type
attempted act =
case act of
(Result.Ok _) -> None
(Result.Err msg) ->
(Failed (Struct.Error.new Struct.Error.Failure (toString msg)))
|