more refact
This commit is contained in:
@@ -19,23 +19,20 @@ type letterbox struct {
|
||||
Bar float64
|
||||
}
|
||||
|
||||
func (l *letterbox) GetName() string { return l.Name }
|
||||
func (l *letterbox) Layer() inkwell.Layer { return inkwell.LayerScene }
|
||||
func (l *letterbox) GetName() string { return l.Name }
|
||||
func (l *letterbox) VisibleWhen() inkwell.Condition { return whenCutscene }
|
||||
func (l *letterbox) Layer() inkwell.Layer { return inkwell.LayerScene }
|
||||
|
||||
func (l *letterbox) Tick(ctx *inkwell.UICtx) {
|
||||
if World.Mode() != ModeCutscene || !World.TapeWaiting() {
|
||||
if !World.TapeWaiting() {
|
||||
return
|
||||
}
|
||||
|
||||
if inpututil.IsKeyJustPressed(ebiten.KeySpace) {
|
||||
World.TakeTapeOffer()
|
||||
}
|
||||
}
|
||||
|
||||
func (l *letterbox) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) {
|
||||
if World.Mode() != ModeCutscene {
|
||||
return
|
||||
}
|
||||
g := ctx.Game
|
||||
th := g.Theme()
|
||||
bar := l.Bar
|
||||
@@ -48,7 +45,7 @@ func (l *letterbox) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) {
|
||||
vector.DrawFilledRect(dst, 0, h-float32(bar), w, float32(bar), black, false)
|
||||
|
||||
if World.TapeWaiting() {
|
||||
msg := "SPACE — " + TapeDisplayName(Dex) + " has something to say"
|
||||
drawTextC(dst, msg, g.Width-textW(msg)-4, g.Height-int(bar)+4, th.ChatLogResponse)
|
||||
msg := "SPACE — " + g.CharacterLabel(Dex) + " has something to say"
|
||||
g.DrawText(dst, msg, g.Width-inkwell.TextWidth(msg)-4, g.Height-int(bar)+4, th.ChatLogResponse)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user