register logic

This commit is contained in:
2026-08-29 23:59:56 +02:00
parent ddea3b0893
commit 94649a38fe
83 changed files with 830 additions and 699 deletions
+6 -7
View File
@@ -7,17 +7,16 @@ import (
"github.com/hajimehoshi/ebiten/v2"
)
type UseWithGuard struct {
type useWithGuard struct {
Name string
W *World
}
func (u *UseWithGuard) GetName() string { return u.Name }
func (u *UseWithGuard) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) {}
func (u *useWithGuard) GetName() string { return u.Name }
func (u *useWithGuard) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) {}
func (u *UseWithGuard) Tick(ctx *inkwell.UICtx) {
func (u *useWithGuard) Tick(ctx *inkwell.UICtx) {
g := ctx.Game
if !u.W.HUDVisible() || !g.Input.LeftClicked() {
if !World.HUDVisible() || !g.Input.LeftClicked() {
return
}
sel := g.Inventory.Selected()
@@ -42,7 +41,7 @@ func (u *UseWithGuard) Tick(ctx *inkwell.UICtx) {
g.State.NoteTalked(key)
n := g.State.Talked(key)
u.W.Do(inkwell.Seq(
World.Do(inkwell.Seq(
inkwell.Say(Paul, pick(paulFails, n)),
TapeSay(Dex, dexFail(n)),
))