works on admin page

This commit is contained in:
2019-11-21 15:57:01 +01:00
parent 75968f73c1
commit a81d184af6
8 changed files with 252 additions and 120 deletions

View File

@@ -10,6 +10,7 @@ import Api
, RequestData(..)
, confirmAction
)
import Api.Player exposing (Player, Wealth, blankPlayer)
import Browser.Navigation as Nav
import Dict exposing (Dict)
import Html exposing (..)
@@ -42,7 +43,7 @@ type alias State =
-- , inventoryItems : Loot
-- Fetched on init
, player : Api.Player
, player : Player
, playerLoot : Loot
, groupLoot : Loot
, merchantLoot : Loot
@@ -78,7 +79,7 @@ init navKey playerId =
Nothing
Nothing
Nothing
Api.blankPlayer
blankPlayer
[]
[]
[]
@@ -88,11 +89,11 @@ init navKey playerId =
Nothing
""
(Wealth.init
Api.blankPlayer.wealth
blankPlayer.wealth
)
[]
, Cmd.batch
[ Api.fetchPlayer GotPlayer playerId
[ Api.Player.get GotPlayer playerId
, Api.fetchClaimsOf GotClaims playerId
, Api.fetchLoot GotLoot (Api.OfPlayer playerId)
, Api.fetchLoot GotLoot Api.OfGroup
@@ -129,7 +130,7 @@ viewNotification model =
-- PLAYER BAR
viewPlayerBar : Api.Player -> List (Html Msg) -> Wealth.Model -> Html Msg
viewPlayerBar : Player -> List (Html Msg) -> Wealth.Model -> Html Msg
viewPlayerBar player actionControls wealthModel =
section [ class "hero is-dark is-bold" ]
[ div [ class "hero-body" ]
@@ -711,7 +712,7 @@ type Msg
= ApiMsg Api.Msg
| GotLoot Api.ToChest (HttpResult Loot)
| GotClaims (HttpResult Claims)
| GotPlayer (HttpResult Api.Player)
| GotPlayer (HttpResult Player)
-- Chest UI
| ClearNotification
| SetContent ChestContent
@@ -1177,7 +1178,7 @@ applyUpdate u model =
| player =
{ player
| wealth =
Api.Wealth
Api.Player.Wealth
(wealth.cp + diff.cp)
(wealth.sp + diff.sp)
(wealth.gp + diff.gp)