Increase dialogue modality, display keyboard dialogue
This commit is contained in:
@@ -94,7 +94,7 @@ func (d *Driver) Update(screenX, screenY int) error {
|
||||
d.cursorOrig = image.Pt(int(mnX), int(mnY))
|
||||
|
||||
// Dispatch notifications to our widgets
|
||||
for _, hoverable := range d.hoverables() {
|
||||
for _, hoverable := range d.activeHoverables() {
|
||||
inBounds := d.cursorOrig.In(hoverable.bounds())
|
||||
|
||||
d.hoverStartEvent(hoverable, inBounds)
|
||||
@@ -106,7 +106,7 @@ func (d *Driver) Update(screenX, screenY int) error {
|
||||
}
|
||||
|
||||
mouseIsDown := ebiten.IsMouseButtonPressed(ebiten.MouseButtonLeft)
|
||||
for _, clickable := range d.clickables() {
|
||||
for _, clickable := range d.activeClickables() {
|
||||
inBounds := d.cursorOrig.In(clickable.bounds())
|
||||
mouseWasDown := clickable.mouseDownState()
|
||||
|
||||
@@ -115,7 +115,7 @@ func (d *Driver) Update(screenX, screenY int) error {
|
||||
d.mouseUpEvent(clickable, inBounds, mouseWasDown, mouseIsDown)
|
||||
}
|
||||
|
||||
for _, mouseable := range d.mouseables() {
|
||||
for _, mouseable := range d.activeMouseables() {
|
||||
mouseable.registerMousePosition(d.cursorOrig)
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ func (d *Driver) Draw(screen *ebiten.Image) error {
|
||||
|
||||
var do ebiten.DrawImageOptions
|
||||
|
||||
for _, paint := range d.paintables() {
|
||||
for _, paint := range d.activePaintables() {
|
||||
for _, region := range paint.regions(d.ticks) {
|
||||
x, y := d.orig2native.Apply(float64(region.offset.X), float64(region.offset.Y))
|
||||
|
||||
@@ -165,29 +165,66 @@ func (d *Driver) Cursor() (*ebiten.Image, *ebiten.DrawImageOptions, error) {
|
||||
return cursor.Image, op, nil
|
||||
}
|
||||
|
||||
func (d *Driver) clickables() []clickable {
|
||||
func (d *Driver) allClickables() []clickable {
|
||||
var out []clickable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.clickables()...)
|
||||
}
|
||||
|
||||
for _, widget := range d.dialogues {
|
||||
out = append(out, widget.clickables()...)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) allFreezables() []freezable {
|
||||
var out []freezable
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.freezables()...)
|
||||
}
|
||||
|
||||
for _, widget := range d.dialogues {
|
||||
out = append(out, widget.freezables()...)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) allValueables() []valueable {
|
||||
var out []valueable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.valueables()...)
|
||||
}
|
||||
|
||||
for _, widget := range d.dialogues {
|
||||
out = append(out, widget.valueables()...)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) activeClickables() []clickable {
|
||||
if d.activeDialogue != nil {
|
||||
return d.activeDialogue.clickables()
|
||||
}
|
||||
|
||||
var out []clickable
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.clickables()...)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) freezables() []freezable {
|
||||
var out []freezable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.freezables()...)
|
||||
func (d *Driver) activeHoverables() []hoverable {
|
||||
if d.activeDialogue != nil {
|
||||
return d.activeDialogue.hoverables()
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) hoverables() []hoverable {
|
||||
var out []hoverable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.hoverables()...)
|
||||
}
|
||||
@@ -195,9 +232,12 @@ func (d *Driver) hoverables() []hoverable {
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) mouseables() []mouseable {
|
||||
var out []mouseable
|
||||
func (d *Driver) activeMouseables() []mouseable {
|
||||
if d.activeDialogue != nil {
|
||||
return d.activeDialogue.mouseables()
|
||||
}
|
||||
|
||||
var out []mouseable
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.mouseables()...)
|
||||
}
|
||||
@@ -205,7 +245,7 @@ func (d *Driver) mouseables() []mouseable {
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) paintables() []paintable {
|
||||
func (d *Driver) activePaintables() []paintable {
|
||||
var out []paintable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
@@ -218,13 +258,3 @@ func (d *Driver) paintables() []paintable {
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (d *Driver) valueables() []valueable {
|
||||
var out []valueable
|
||||
|
||||
for _, widget := range d.widgets {
|
||||
out = append(out, widget.valueables()...)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
Reference in New Issue
Block a user