From d56ca38dcb437c0124fae2f5102cf4f276d16852 Mon Sep 17 00:00:00 2001 From: Artus Date: Tue, 5 Nov 2019 15:22:14 +0100 Subject: [PATCH] starts cleaning up a bit --- src/Main.elm | 27 ++++++++++++++++++++------- tmux.sh | 3 ++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/Main.elm b/src/Main.elm index 6d1507a..accd18b 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -13,6 +13,8 @@ import Json.Decode exposing (Decoder, field, list, string, int, succeed) import Json.Encode as E import Url.Parser as P exposing (Parser, (), oneOf, s) import Set exposing (Set) + + -- Main main : Program () Model Msg @@ -58,17 +60,28 @@ init flags url key = Just r -> r Nothing -> PlayerChest in - ( Model (State key route "" False Nothing Nothing) blankPlayer [] Nothing Nothing Nothing Nothing, fetchInitialData 0) + ( Model + (State key route "" False Nothing Nothing) + blankPlayer + [] + Nothing + Nothing + Nothing + Nothing + , fetchInitialData 0) fetchInitialData : Int -> Cmd Msg fetchInitialData playerId = - Cmd.batch [ initPlayer playerId - , fetchShopInventory - , fetchGroupLoot - ] + Cmd.batch + [ initPlayer playerId + , fetchShopInventory + , fetchGroupLoot + ] + +--- -- PLAYER --- +--- type alias Player = { id: Int , name: String @@ -77,7 +90,7 @@ type alias Player = } blankPlayer = - Player 0 "Loading" 0 (Wealth 0 0 0 0) + Player 0 "Loot-a-lot" 0 (Wealth 0 0 0 0) initPlayer id = Cmd.batch [fetchPlayer id, fetchLoot id, fetchClaims id] diff --git a/tmux.sh b/tmux.sh index adf5433..d9bb323 100755 --- a/tmux.sh +++ b/tmux.sh @@ -2,6 +2,7 @@ tmux new-session -d -s elm tmux split-window -v "elm reactor --port 8080" -tmux split-window -h -c $HOME/Projets/rust/lootalot "cargo run" +tmux split-window -v -c $HOME/Projets/rust/lootalot "cargo run" +tmux select-pane -U tmux select-pane -U tmux attach-session -t elm