Skip to content

Commit

Permalink
Fixes #11
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Smart <[email protected]>
  • Loading branch information
mcred committed Feb 20, 2020
1 parent 4f18e26 commit ab3fd01
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions internal/app/common/Collectibles.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ func Gold() Attribute {
}
func GoldDisplay() Attribute {
return Attribute{0x19C, 4, true}
}

func Stardust() Attribute {
return Attribute{0x29C, 1, false}
}
func StardustDisplay() Attribute {
return Attribute{0x1A8, 1, false}
}
13 changes: 12 additions & 1 deletion internal/app/ui/Form.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,19 @@ func createPartyForm(s *Slot) *fyne.Container {
s.SetValueAtLocation(common.Gold(), i)
s.SetValueAtLocation(common.GoldDisplay(), i)
}
e2 := widget.NewEntry()
e2.SetPlaceHolder(strconv.Itoa(s.GetValueByAttribute(common.Stardust())))
e2.OnChanged = func(v string) {
i, _ := strconv.Atoi(v)
s.SetValueAtLocation(common.Stardust(), i)
s.SetValueAtLocation(common.StardustDisplay(), i)
}

return fyne.NewContainerWithLayout(layout.NewHBoxLayout(),
widget.NewLabel("Party"), s1, s2, s3, widget.NewLabel("Gold"), e1)
widget.NewLabel("Party"), s1, s2, s3,
widget.NewLabel("Gold"), e1,
widget.NewLabel("Stardust"), e2,
)
}

func createCharacterBox(b *widget.Box, c characters.Character, w inventory.Inventory, s *Slot, window fyne.Window) {
Expand Down

0 comments on commit ab3fd01

Please sign in to comment.