2020-10-12 17:29:30 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fyne.io/fyne/widget"
|
|
|
|
)
|
|
|
|
|
|
|
|
type panelDevices struct {
|
|
|
|
s *state
|
2020-10-13 22:26:47 +00:00
|
|
|
w *widget.Box
|
2020-10-12 17:29:30 +00:00
|
|
|
joystick *panelJoystick
|
|
|
|
}
|
|
|
|
|
|
|
|
func newPanelDevices(s *state) *panelDevices {
|
|
|
|
var pd panelDevices
|
|
|
|
pd.s = s
|
2020-10-13 22:26:47 +00:00
|
|
|
pd.w = widget.NewVBox()
|
2020-10-12 17:29:30 +00:00
|
|
|
|
|
|
|
pd.joystick = newPanelJoystick()
|
2020-10-13 22:26:47 +00:00
|
|
|
pd.w.Append(pd.joystick.w)
|
2020-10-12 17:29:30 +00:00
|
|
|
|
2020-10-13 22:26:47 +00:00
|
|
|
var cards = s.a.GetCards()
|
|
|
|
for i, card := range cards {
|
|
|
|
if card != nil && card.GetName() != "" {
|
|
|
|
pd.w.Append(newPanelCard(i, card).w)
|
|
|
|
}
|
|
|
|
}
|
2020-10-12 17:29:30 +00:00
|
|
|
|
|
|
|
return &pd
|
|
|
|
}
|