Documentation ¶
Index ¶
- Constants
- func Show(app fyne.App, servername string, l *rp.LoginResponse, conn *grpc.ClientConn, ...)
- type ActionsPanel
- type AdvancePanel
- type App
- func (a *App) GetMap() error
- func (a *App) GetUnitCommander(unitID int32) *rp.Command
- func (a *App) GetUnits() error
- func (a *App) MinSize() fyne.Size
- func (a *App) Phaser()
- func (a *App) PlayAudio(tune string)
- func (a *App) PlaySystemAudio(name string)
- func (a *App) Tab(tab int)
- func (a *App) ToggleTheme()
- type BriefingPanel
- type FooterBar
- type FormationsPanel
- type HeaderBar
- type MapPanel
- type MapWidget
- func (mw *MapWidget) ApplyTheme()
- func (mw *MapWidget) CommandsUpdated(data fyne.DataMap)
- func (mw *MapWidget) CreateRenderer() fyne.WidgetRenderer
- func (mw *MapWidget) Hide()
- func (mw *MapWidget) MinSize() fyne.Size
- func (mw *MapWidget) Move(pos fyne.Position)
- func (mw *MapWidget) Position() fyne.Position
- func (mw *MapWidget) Resize(size fyne.Size)
- func (mw *MapWidget) Select(id int32) (*rp.Command, bool)
- func (mw *MapWidget) SetCommands()
- func (mw *MapWidget) Show()
- func (mw *MapWidget) Size() fyne.Size
- func (mw *MapWidget) Tapped(event *fyne.PointEvent)
- func (mw *MapWidget) TappedSecondary(event *fyne.PointEvent)
- func (mw *MapWidget) Visible() bool
- type OrdersPanel
- type PlotWidget
- func (p *PlotWidget) AddSet(data timedata)
- func (p *PlotWidget) ApplyTheme()
- func (p *PlotWidget) Clear()
- func (p *PlotWidget) CreateRenderer() fyne.WidgetRenderer
- func (p *PlotWidget) Hide()
- func (p *PlotWidget) MinSize() fyne.Size
- func (p *PlotWidget) Move(pos fyne.Position)
- func (p *PlotWidget) Position() fyne.Position
- func (p *PlotWidget) Resize(size fyne.Size)
- func (p *PlotWidget) Show()
- func (p *PlotWidget) Size() fyne.Size
- func (p *PlotWidget) Visible() bool
- type SurrenderPanel
- type TapIcon
- type TapLabel
- type TapRect
- type UnitCommand
- type UnitDetails
- type UnitOverview
- type UnitsPanel
- type WithdrawPanel
Constants ¶
const ( TabBriefing = iota TabUnits TabOrders TabActions TabMap TabFormation TabAdvance TabWithdraw TabSurrender )
Enum for the Tabs in the main window
Variables ¶
This section is empty.
Functions ¶
func Show ¶
func Show(app fyne.App, servername string, l *rp.LoginResponse, conn *grpc.ClientConn, gameServer rp.GameServiceClient, store *store.Store)
Show creates the application UI
Types ¶
type ActionsPanel ¶
type ActionsPanel struct { Box *fyne.Container Scroll *widget.ScrollContainer Header *widget.Label Actions []*actionWidget // contains filtered or unexported fields }
ActionsPanel controls the actions
func (*ActionsPanel) CanvasObject ¶
func (a *ActionsPanel) CanvasObject() fyne.CanvasObject
CanvasObject gets the top level canvas object
type AdvancePanel ¶
type AdvancePanel struct { Box *fyne.Container Header *widget.Label Notes *widget.Label // contains filtered or unexported fields }
AdvancePanel is the UI for ordering a general advance
func (*AdvancePanel) CanvasObject ¶
func (a *AdvancePanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the AdvancePanel
type App ¶
type App struct { // game state ServerName string GameName string GameTime time.Time Briefing string Commanders []string Commands []*rp.Command Enemy []*rp.Command TeamName string Token rp.TokenMessage Expires time.Time Phase string MapData *rp.MapData // contains filtered or unexported fields }
App is the top level object to contain the application data
func (*App) GetUnitCommander ¶
GetUnitCommander gets the commander for the given unit
func (*App) MinSize ¶
MinSize returns the minimum size for the panel objects - helper function for panels to get a consistent sizing hint
func (*App) Phaser ¶
func (a *App) Phaser()
Phaser is a goroutine that loops on a 3 second timer to fetch the game time
func (*App) PlaySystemAudio ¶
PlaySystemAudio plays one of the system tunes
func (*App) ToggleTheme ¶
func (a *App) ToggleTheme()
ToggleTheme changes the theme between darkMode and lightMode and back again
type BriefingPanel ¶
type BriefingPanel struct { Box *widget.Box Scroll *widget.ScrollContainer Header *widget.Label Notes *widget.Label // contains filtered or unexported fields }
BriefingPanel in the UI for the briefing
func (*BriefingPanel) CanvasObject ¶
func (b *BriefingPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element
type FooterBar ¶
type FooterBar struct { // contains filtered or unexported fields }
FooterBar is the UI for the footer
func (*FooterBar) CanvasObject ¶
func (f *FooterBar) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element in the footer
func (*FooterBar) NotDone ¶
func (f *FooterBar) NotDone()
NotDone sets the done flag back to not done. Use this whenever the player does an action that un-does the fact that they are finished with the turn
func (*FooterBar) ToggleDone ¶
func (f *FooterBar) ToggleDone()
ToggleDone toggles the Done flag to signal that the player is ready for the next phase
type FormationsPanel ¶
type FormationsPanel struct { Box *widget.Box Scroll *widget.ScrollContainer // contains filtered or unexported fields }
FormationsPanel is the UI for the formations
func (*FormationsPanel) CanvasObject ¶
func (f *FormationsPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the formations panel
type HeaderBar ¶
type HeaderBar struct { Box *widget.Box TeamName *widget.Label GameName *widget.Label GameTime *widget.Label Toolbar *widget.Toolbar // contains filtered or unexported fields }
HeaderBar is the UI for the header
func (*HeaderBar) CanvasObject ¶
func (h *HeaderBar) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the header
type MapPanel ¶
type MapPanel struct {
// contains filtered or unexported fields
}
MapPanel is the UI for the map
func (*MapPanel) CanvasObject ¶
func (m *MapPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the map
func (*MapPanel) SetCommand ¶
SetCommand sets the currently selected command on the map
type MapWidget ¶
type MapWidget struct {
// contains filtered or unexported fields
}
MapWidget is a complete map viewer widget ... or will be when it grows up
func (*MapWidget) ApplyTheme ¶
func (mw *MapWidget) ApplyTheme()
ApplyTheme applies the theme to the mapWidget
func (*MapWidget) CommandsUpdated ¶
CommandsUpdated is a dataAPI listener for the map
func (*MapWidget) CreateRenderer ¶
func (mw *MapWidget) CreateRenderer() fyne.WidgetRenderer
CreateRenderer builds a new renderer
func (*MapWidget) SetCommands ¶
func (mw *MapWidget) SetCommands()
SetCommands rebuilds a new set of gridCommands for this map
func (*MapWidget) Tapped ¶
func (mw *MapWidget) Tapped(event *fyne.PointEvent)
Tapped is called when the user taps the map widget
func (*MapWidget) TappedSecondary ¶
func (mw *MapWidget) TappedSecondary(event *fyne.PointEvent)
TappedSecondary is called when the user right-taps the map widget
type OrdersPanel ¶
type OrdersPanel struct { Box *fyne.Container Scroll *widget.ScrollContainer // contains filtered or unexported fields }
OrdersPanel is the UI for placing commander orders
func (*OrdersPanel) CanvasObject ¶
func (o *OrdersPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the orders
type PlotWidget ¶
type PlotWidget struct {
// contains filtered or unexported fields
}
PlotWidget plots a set of data
func (*PlotWidget) AddSet ¶
func (p *PlotWidget) AddSet(data timedata)
AddSet adds a set of data to the plot
func (*PlotWidget) ApplyTheme ¶
func (p *PlotWidget) ApplyTheme()
ApplyTheme applies the theme to the plotWidget
func (*PlotWidget) CreateRenderer ¶
func (p *PlotWidget) CreateRenderer() fyne.WidgetRenderer
CreateRenderer builds a new renderer
func (*PlotWidget) MinSize ¶
func (p *PlotWidget) MinSize() fyne.Size
MinSize returns the minSize of the plotWidget
func (*PlotWidget) Move ¶
func (p *PlotWidget) Move(pos fyne.Position)
Move orders the plotWidget to be moved
func (*PlotWidget) Position ¶
func (p *PlotWidget) Position() fyne.Position
Position returns the current position of the plotWidget
func (*PlotWidget) Resize ¶
func (p *PlotWidget) Resize(size fyne.Size)
Resize resizes the plotWidget
func (*PlotWidget) Size ¶
func (p *PlotWidget) Size() fyne.Size
Size returns the current size of the plotWidget
func (*PlotWidget) Visible ¶
func (p *PlotWidget) Visible() bool
Visible returns whether the plotWidget is visible or not
type SurrenderPanel ¶
type SurrenderPanel struct { Box *fyne.Container Header *widget.Label Notes *widget.Label // contains filtered or unexported fields }
SurrenderPanel is the UI for editting surrender terms
func (*SurrenderPanel) CanvasObject ¶
func (s *SurrenderPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI element for the SurrenderPanel
type TapIcon ¶
type TapIcon struct { widget.Box OnTapped func() OnSecondary func() // contains filtered or unexported fields }
TapIcon is an Icon that implements Tappable interface
func NewTapIcon ¶
NewTapIcon is a wrapper function to create a new tappable icon
func (*TapIcon) CreateRenderer ¶
func (l *TapIcon) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates a renderer for the TapIcon
func (*TapIcon) TappedSecondary ¶
func (l *TapIcon) TappedSecondary(*fyne.PointEvent)
TappedSecondary handler for each TapIcon
type TapLabel ¶
TapLabel is a label that implements Tappable interface
func NewTapLabel ¶
func NewTapLabel(text string, alignment fyne.TextAlign, style fyne.TextStyle, tapped func(), secondary func()) *TapLabel
NewTapLabel is a wrapper function to create a new tappable Label
func (*TapLabel) CreateRenderer ¶
func (l *TapLabel) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates a renderer for the TapLabel
func (*TapLabel) Tapped ¶
func (l *TapLabel) Tapped(*fyne.PointEvent)
Tapped handler for each tapLabel
func (*TapLabel) TappedSecondary ¶
func (l *TapLabel) TappedSecondary(*fyne.PointEvent)
TappedSecondary handler for each tapLabel
type TapRect ¶
type TapRect struct { widget.Box OnTapped func() OnSecondary func() // contains filtered or unexported fields }
TapRect is a Rect that implements Tappable interface
func NewTapRect ¶
NewTapRect is a wrapper function to create a new tappable rectangle
func (*TapRect) CreateRenderer ¶
func (l *TapRect) CreateRenderer() fyne.WidgetRenderer
CreateRenderer creates a renderer for the TapIcon
func (*TapRect) TappedSecondary ¶
func (l *TapRect) TappedSecondary(*fyne.PointEvent)
TappedSecondary handler for each TapIcon
type UnitCommand ¶
type UnitCommand struct {
// contains filtered or unexported fields
}
UnitCommand holds the UI for veiwing units overview
func (*UnitCommand) CanvasObject ¶
func (u *UnitCommand) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level widget in the UnitsPanel
func (*UnitCommand) Populate ¶
func (u *UnitCommand) Populate(command *rp.Command)
Populate refreshes the UnitCommand from the given command data
type UnitDetails ¶
type UnitDetails struct {
// contains filtered or unexported fields
}
UnitDetails holds the UI for veiwing unit details
func (*UnitDetails) CanvasObject ¶
func (u *UnitDetails) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level widget in the UnitsPanel
func (*UnitDetails) Populate ¶
func (u *UnitDetails) Populate(unit *rp.Unit)
Populate refreshes the UnitDetail fields from the given unit data
type UnitOverview ¶
type UnitOverview struct {
// contains filtered or unexported fields
}
UnitOverview holds the UI for veiwing units overview
func (*UnitOverview) CanvasObject ¶
func (u *UnitOverview) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level widget in the UnitsPanel
type UnitsPanel ¶
type UnitsPanel struct { Tabs *widget.TabContainer Overview *UnitOverview Command *UnitCommand Details *UnitDetails // contains filtered or unexported fields }
UnitsPanel holds the UI for veiwing units
func (*UnitsPanel) CanvasObject ¶
func (u *UnitsPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level widget in the UnitsPanel
func (*UnitsPanel) ShowCommand ¶
func (u *UnitsPanel) ShowCommand(command *rp.Command)
ShowCommand navigates to the commander details and populates the commander
func (*UnitsPanel) ShowUnit ¶
func (u *UnitsPanel) ShowUnit(unit *rp.Unit)
ShowUnit navigates to the unit details and populates the unit
type WithdrawPanel ¶
type WithdrawPanel struct { Box *fyne.Container Header *widget.Label Notes *widget.Label // contains filtered or unexported fields }
WithdrawPanel is the UI for ordering a general withdrawal
func (*WithdrawPanel) CanvasObject ¶
func (w *WithdrawPanel) CanvasObject() fyne.CanvasObject
CanvasObject returns the top level UI for the WithdrawPanel
Source Files ¶
- action_widget.go
- actions.go
- advance.go
- app.go
- audio.go
- briefing.go
- bundle.go
- colors.go
- footerbar.go
- formations.go
- griddata.go
- headerbar.go
- map.go
- map_render.go
- map_widget.go
- order_widget.go
- orders.go
- phaser.go
- plot_render.go
- plot_widget.go
- rivers.go
- string_utils.go
- surrender.go
- tap_icon.go
- tap_label.go
- tap_rect.go
- unit_command.go
- unit_details.go
- unit_overview.go
- units_panel.go
- withdraw.go