summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/roster-editor/src/Update')
-rw-r--r-- | src/roster-editor/src/Update/DisplayCharacterInfo.elm | 53 | ||||
-rw-r--r-- | src/roster-editor/src/Update/GoToMainMenu.elm | 4 | ||||
-rw-r--r-- | src/roster-editor/src/Update/HandleServerReply.elm | 39 | ||||
-rw-r--r-- | src/roster-editor/src/Update/JoinBattle.elm | 5 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SelectCharacter.elm | 2 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SelectTab.elm | 3 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SendLoadRosterRequest.elm | 3 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SendRoster.elm | 2 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetArmor.elm | 8 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetGlyph.elm | 2 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetGlyphBoard.elm | 2 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetName.elm | 4 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetPortrait.elm | 8 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetRequestedHelp.elm | 3 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SetWeapon.elm | 8 | ||||
-rw-r--r-- | src/roster-editor/src/Update/SwitchWeapons.elm | 6 | ||||
-rw-r--r-- | src/roster-editor/src/Update/ToggleBattleIndex.elm | 3 |
17 files changed, 57 insertions, 98 deletions
diff --git a/src/roster-editor/src/Update/DisplayCharacterInfo.elm b/src/roster-editor/src/Update/DisplayCharacterInfo.elm deleted file mode 100644 index e482e2f..0000000 --- a/src/roster-editor/src/Update/DisplayCharacterInfo.elm +++ /dev/null @@ -1,53 +0,0 @@ -module Update.DisplayCharacterInfo exposing (apply_to) --- Elm ------------------------------------------------------------------------- -import Array -import Task - --- Map ------------------------------------------------------------------- -import Action.Scroll - -import Struct.Character -import Struct.Event -import Struct.Model -import Struct.UI - --------------------------------------------------------------------------------- --- LOCAL ----------------------------------------------------------------------- --------------------------------------------------------------------------------- -scroll_to_char : Struct.Model.Type -> Int -> (Cmd Struct.Event.Type) -scroll_to_char model char_ix = - case (Array.get char_ix model.characters) of - (Just char) -> - (Task.attempt - (Struct.Event.attempted) - (Action.Scroll.to - (Struct.Character.get_location char) - model.ui - ) - ) - - Nothing -> - Cmd.none - --------------------------------------------------------------------------------- --- EXPORTED -------------------------------------------------------------------- --------------------------------------------------------------------------------- -apply_to : ( - Struct.Model.Type -> - Int -> - (Struct.Model.Type, (Cmd Struct.Event.Type)) - ) -apply_to model target_ref = - ( - {model | - ui = - (Struct.UI.set_displayed_tab - Struct.UI.StatusTab - (Struct.UI.set_previous_action - (Just (Struct.UI.SelectedCharacter target_ref)) - model.ui - ) - ) - }, - (scroll_to_char model target_ref) - ) diff --git a/src/roster-editor/src/Update/GoToMainMenu.elm b/src/roster-editor/src/Update/GoToMainMenu.elm index f2ec989..a0471f2 100644 --- a/src/roster-editor/src/Update/GoToMainMenu.elm +++ b/src/roster-editor/src/Update/GoToMainMenu.elm @@ -1,9 +1,9 @@ module Update.GoToMainMenu exposing (apply_to) --- Elm ------------------------------------------------------------------------- --- Battle ---------------------------------------------------------------------- +-- Shared ---------------------------------------------------------------------- import Action.Ports +-- Local Module ---------------------------------------------------------------- import Constants.IO import Struct.Model diff --git a/src/roster-editor/src/Update/HandleServerReply.elm b/src/roster-editor/src/Update/HandleServerReply.elm index 0836a76..3469ea7 100644 --- a/src/roster-editor/src/Update/HandleServerReply.elm +++ b/src/roster-editor/src/Update/HandleServerReply.elm @@ -6,6 +6,7 @@ import Dict import Http import Url + -- Shared ---------------------------------------------------------------------- import Action.Ports @@ -13,10 +14,14 @@ import Struct.Flags import Util.Http --- Roster Editor --------------------------------------------------------------- +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Armor +import BattleCharacters.Struct.Portrait +import BattleCharacters.Struct.Weapon + +-- Local Module ---------------------------------------------------------------- import Constants.IO -import Struct.Armor import Struct.CharacterRecord import Struct.Error import Struct.Event @@ -24,9 +29,7 @@ import Struct.Glyph import Struct.GlyphBoard import Struct.Inventory import Struct.Model -import Struct.Portrait import Struct.ServerReply -import Struct.Weapon -------------------------------------------------------------------------------- -- TYPES ----------------------------------------------------------------------- @@ -35,27 +38,35 @@ import Struct.Weapon -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- -weapon_getter : Struct.Model.Type -> Struct.Weapon.Ref -> Struct.Weapon.Type +weapon_getter : ( + Struct.Model.Type -> + BattleCharacters.Struct.Weapon.Ref -> + BattleCharacters.Struct.Weapon.Type + ) weapon_getter model ref = case (Dict.get ref model.weapons) of (Just w) -> w - Nothing -> Struct.Weapon.none + Nothing -> BattleCharacters.Struct.Weapon.none -armor_getter : Struct.Model.Type -> Struct.Armor.Ref -> Struct.Armor.Type +armor_getter : ( + Struct.Model.Type -> + BattleCharacters.Struct.Armor.Ref -> + BattleCharacters.Struct.Armor.Type + ) armor_getter model ref = case (Dict.get ref model.armors) of (Just w) -> w - Nothing -> Struct.Armor.none + Nothing -> BattleCharacters.Struct.Armor.none portrait_getter : ( Struct.Model.Type -> - Struct.Portrait.Ref -> - Struct.Portrait.Type + BattleCharacters.Struct.Portrait.Ref -> + BattleCharacters.Struct.Portrait.Type ) portrait_getter model ref = case (Dict.get ref model.portraits) of (Just w) -> w - Nothing -> Struct.Portrait.default + Nothing -> BattleCharacters.Struct.Portrait.default ----------- @@ -99,7 +110,7 @@ goto url current_state = ) add_armor : ( - Struct.Armor.Type -> + BattleCharacters.Struct.Armor.Type -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) ) @@ -108,7 +119,7 @@ add_armor ar current_state = ((Struct.Model.add_armor ar model), cmds) add_portrait : ( - Struct.Portrait.Type -> + BattleCharacters.Struct.Portrait.Type -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) ) @@ -135,7 +146,7 @@ add_glyph_board glb current_state = ((Struct.Model.add_glyph_board glb model), cmds) add_weapon : ( - Struct.Weapon.Type -> + BattleCharacters.Struct.Weapon.Type -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) -> (Struct.Model.Type, (List (Cmd Struct.Event.Type))) ) diff --git a/src/roster-editor/src/Update/JoinBattle.elm b/src/roster-editor/src/Update/JoinBattle.elm index eb164bc..d613d89 100644 --- a/src/roster-editor/src/Update/JoinBattle.elm +++ b/src/roster-editor/src/Update/JoinBattle.elm @@ -1,9 +1,6 @@ module Update.JoinBattle exposing (apply_to) --- Elm ------------------------------------------------------------------------- ---import Array - --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Comm.JoinBattle import Struct.Event diff --git a/src/roster-editor/src/Update/SelectCharacter.elm b/src/roster-editor/src/Update/SelectCharacter.elm index e85dbdd..1e408be 100644 --- a/src/roster-editor/src/Update/SelectCharacter.elm +++ b/src/roster-editor/src/Update/SelectCharacter.elm @@ -3,7 +3,7 @@ module Update.SelectCharacter exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Array --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Error import Struct.Event import Struct.Model diff --git a/src/roster-editor/src/Update/SelectTab.elm b/src/roster-editor/src/Update/SelectTab.elm index a8cf436..dff9c21 100644 --- a/src/roster-editor/src/Update/SelectTab.elm +++ b/src/roster-editor/src/Update/SelectTab.elm @@ -1,7 +1,6 @@ module Update.SelectTab exposing (apply_to) --- Elm ------------------------------------------------------------------------- --- Map ------------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Model import Struct.Event import Struct.UI diff --git a/src/roster-editor/src/Update/SendLoadRosterRequest.elm b/src/roster-editor/src/Update/SendLoadRosterRequest.elm index 2bbe9da..21f8d00 100644 --- a/src/roster-editor/src/Update/SendLoadRosterRequest.elm +++ b/src/roster-editor/src/Update/SendLoadRosterRequest.elm @@ -1,7 +1,6 @@ module Update.SendLoadRosterRequest exposing (apply_to) --- Elm ------------------------------------------------------------------------- --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Comm.LoadRoster import Struct.Event diff --git a/src/roster-editor/src/Update/SendRoster.elm b/src/roster-editor/src/Update/SendRoster.elm index b6f0510..d752449 100644 --- a/src/roster-editor/src/Update/SendRoster.elm +++ b/src/roster-editor/src/Update/SendRoster.elm @@ -3,7 +3,7 @@ module Update.SendRoster exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Array --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Comm.UpdateRoster import Struct.Character diff --git a/src/roster-editor/src/Update/SetArmor.elm b/src/roster-editor/src/Update/SetArmor.elm index 1440966..5878be2 100644 --- a/src/roster-editor/src/Update/SetArmor.elm +++ b/src/roster-editor/src/Update/SetArmor.elm @@ -3,8 +3,10 @@ module Update.SetArmor exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- -import Struct.Armor +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Armor + +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model @@ -18,7 +20,7 @@ import Struct.Model -------------------------------------------------------------------------------- apply_to : ( Struct.Model.Type -> - Struct.Armor.Ref -> + BattleCharacters.Struct.Armor.Ref -> (Struct.Model.Type, (Cmd Struct.Event.Type)) ) apply_to model ref = diff --git a/src/roster-editor/src/Update/SetGlyph.elm b/src/roster-editor/src/Update/SetGlyph.elm index 3288d18..aff749b 100644 --- a/src/roster-editor/src/Update/SetGlyph.elm +++ b/src/roster-editor/src/Update/SetGlyph.elm @@ -3,7 +3,7 @@ module Update.SetGlyph exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Glyph diff --git a/src/roster-editor/src/Update/SetGlyphBoard.elm b/src/roster-editor/src/Update/SetGlyphBoard.elm index 5c738a7..45f2b10 100644 --- a/src/roster-editor/src/Update/SetGlyphBoard.elm +++ b/src/roster-editor/src/Update/SetGlyphBoard.elm @@ -3,7 +3,7 @@ module Update.SetGlyphBoard exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.GlyphBoard diff --git a/src/roster-editor/src/Update/SetName.elm b/src/roster-editor/src/Update/SetName.elm index 5879d27..002af51 100644 --- a/src/roster-editor/src/Update/SetName.elm +++ b/src/roster-editor/src/Update/SetName.elm @@ -1,8 +1,6 @@ module Update.SetName exposing (apply_to) --- Elm ------------------------------------------------------------------------- - --- Roster Editor --------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model diff --git a/src/roster-editor/src/Update/SetPortrait.elm b/src/roster-editor/src/Update/SetPortrait.elm index 5b1fe62..dc29c13 100644 --- a/src/roster-editor/src/Update/SetPortrait.elm +++ b/src/roster-editor/src/Update/SetPortrait.elm @@ -3,11 +3,13 @@ module Update.SetPortrait exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Portrait + +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model -import Struct.Portrait -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -18,7 +20,7 @@ import Struct.Portrait -------------------------------------------------------------------------------- apply_to : ( Struct.Model.Type -> - Struct.Portrait.Ref -> + BattleCharacters.Struct.Portrait.Ref -> (Struct.Model.Type, (Cmd Struct.Event.Type)) ) apply_to model ref = diff --git a/src/roster-editor/src/Update/SetRequestedHelp.elm b/src/roster-editor/src/Update/SetRequestedHelp.elm index dfc58db..45e5e93 100644 --- a/src/roster-editor/src/Update/SetRequestedHelp.elm +++ b/src/roster-editor/src/Update/SetRequestedHelp.elm @@ -1,7 +1,6 @@ module Update.SetRequestedHelp exposing (apply_to) --- Elm ------------------------------------------------------------------------- --- Map ------------------------------------------------------------------- +-- Local Module ---------------------------------------------------------------- import Struct.Event import Struct.HelpRequest import Struct.Model diff --git a/src/roster-editor/src/Update/SetWeapon.elm b/src/roster-editor/src/Update/SetWeapon.elm index 24a7885..1f796b0 100644 --- a/src/roster-editor/src/Update/SetWeapon.elm +++ b/src/roster-editor/src/Update/SetWeapon.elm @@ -3,12 +3,14 @@ module Update.SetWeapon exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Weapon + +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model import Struct.UI -import Struct.Weapon -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -19,7 +21,7 @@ import Struct.Weapon -------------------------------------------------------------------------------- apply_to : ( Struct.Model.Type -> - Struct.Weapon.Ref -> + BattleCharacters.Struct.Weapon.Ref -> (Struct.Model.Type, (Cmd Struct.Event.Type)) ) apply_to model ref = diff --git a/src/roster-editor/src/Update/SwitchWeapons.elm b/src/roster-editor/src/Update/SwitchWeapons.elm index f7675f6..38f8b8f 100644 --- a/src/roster-editor/src/Update/SwitchWeapons.elm +++ b/src/roster-editor/src/Update/SwitchWeapons.elm @@ -3,12 +3,14 @@ module Update.SwitchWeapons exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Dict --- Roster Editor --------------------------------------------------------------- +-- Battle Characters ----------------------------------------------------------- +import BattleCharacters.Struct.Weapon + +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model import Struct.UI -import Struct.Weapon -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- diff --git a/src/roster-editor/src/Update/ToggleBattleIndex.elm b/src/roster-editor/src/Update/ToggleBattleIndex.elm index 584c314..27a61c3 100644 --- a/src/roster-editor/src/Update/ToggleBattleIndex.elm +++ b/src/roster-editor/src/Update/ToggleBattleIndex.elm @@ -3,9 +3,10 @@ module Update.ToggleBattleIndex exposing (apply_to) -- Elm ------------------------------------------------------------------------- import Array --- Roster Editor --------------------------------------------------------------- +-- Shared ---------------------------------------------------------------------- import Util.Array +-- Local Module ---------------------------------------------------------------- import Struct.Character import Struct.Event import Struct.Model |