diff --git a/inc/boot.manager.go b/inc/boot.manager.go index 58df517..d5178dd 100644 --- a/inc/boot.manager.go +++ b/inc/boot.manager.go @@ -33,7 +33,6 @@ func New(o Opts) *inkwell.Game { func bootOpening(w *World, start string, finale bool) []inkwell.Action { acts := []inkwell.Action{ EnterScene(w, start), - inkwell.SetFlag(FlagPoliceTip), inkwell.Say(Paul, "Back alley. Just like the clerk said."), TapeSay(Dex, "A government office tipped you off to remove something from a scene. That doesn't strike you as odd?"), diff --git a/inc/character.paul.go b/inc/character.paul.go index 5a751de..5c53b95 100644 --- a/inc/character.paul.go +++ b/inc/character.paul.go @@ -10,8 +10,10 @@ func characterPaul() inkwell.Character { Speed: 96, W: 28, H: 68, - Start: inkwell.Point{X: 120, Y: 232}, - + Start: inkwell.Point{ + X: 120, + Y: 232, + }, SpeechColor: Ink, } } diff --git a/inc/dialog.dex_talk.go b/inc/dialog.dex_talk.go index 963747e..50a2f34 100644 --- a/inc/dialog.dex_talk.go +++ b/inc/dialog.dex_talk.go @@ -9,8 +9,11 @@ func dialogDexTalk() inkwell.Dialogue { Name: DlgDex, Start: "root", Nodes: []inkwell.DialogueNode{{ - Name: "root", - Lines: []inkwell.DialogueLine{{Speaker: Dex, Text: "Talk."}}, + Name: "root", + Lines: []inkwell.DialogueLine{{ + Speaker: Dex, + Text: "Talk.", + }}, Choices: []inkwell.DialogueChoice{ { Text: "What am I doing here, Dex?", diff --git a/inc/dialog.mystery_tape_silent.go b/inc/dialog.mystery_tape_silent.go index 8b5ec5d..cb86ea1 100644 --- a/inc/dialog.mystery_tape_silent.go +++ b/inc/dialog.mystery_tape_silent.go @@ -9,8 +9,11 @@ func dialogMysteryTapeSilent() inkwell.Dialogue { Name: DlgMysteryTape, Start: "root", Nodes: []inkwell.DialogueNode{{ - Name: "root", - Lines: []inkwell.DialogueLine{{Speaker: Dex, Text: "Nothing. Warm, spinning, and silent."}}, + Name: "root", + Lines: []inkwell.DialogueLine{{ + Speaker: Dex, + Text: "Nothing. Warm, spinning, and silent.", + }}, Choices: []inkwell.DialogueChoice{ { Text: "Are you sure it works?", diff --git a/inc/item.black_market_armilla.go b/inc/item.black_market_armilla.go index 774d35e..325f28d 100644 --- a/inc/item.black_market_armilla.go +++ b/inc/item.black_market_armilla.go @@ -13,7 +13,6 @@ func itemBlackMarketArmilla() inkwell.Item { TapeSay(Dex, "Two slots, and both of them lie about the temperature. Don't trade me in for it."), ), OnUseWith: map[string]inkwell.Action{ - ItemNoodleLetter: inkwell.Seq( inkwell.Say(Paul, "A letter and a bracelet. Brilliant."), TapeSay(Dex, "Nothing. Which is what I'd charge for it."), diff --git a/inc/screen.alley.go b/inc/screen.alley.go index be9a49c..9f24cb9 100644 --- a/inc/screen.alley.go +++ b/inc/screen.alley.go @@ -10,11 +10,20 @@ func screenAlley() screen { title: "ALLEY — BEHIND NOODLE'S HOUSE", background: BgAlley, exits: []exit{ - - {to: ScreenNoodleHouse, label: "back out to the street", side: sideLeft}, + { + to: ScreenNoodleHouse, + label: "back out to the street", + side: sideLeft, + }, }, actors: []inkwell.SceneActor{ - {CharacterName: Paul, At: inkwell.Point{X: 120, Y: 232}}, + { + CharacterName: Paul, + At: inkwell.Point{ + X: 120, + Y: 232, + }, + }, }, onEnter: setVarIfEmpty(VarArmillaStrip, "SRP: 1 tape"), hotspots: []inkwell.Hotspot{hidingPlace(), backDoor(), bin(), fireEscape()}, @@ -59,7 +68,6 @@ func backDoor() inkwell.Hotspot { ), OnTalk: inkwell.Say(Paul, "To the door? I'm not there yet."), OnUseWith: map[string]inkwell.Action{ - ItemBlackArmilla: inkwell.Seq( inkwell.Say(Paul, "A black-market bracelet doesn't open a keypad."), TapeSay(Dex, "But you do get an advert out of it."), diff --git a/inc/screen.bbs_terminal.go b/inc/screen.bbs_terminal.go index a44e67d..2ccc775 100644 --- a/inc/screen.bbs_terminal.go +++ b/inc/screen.bbs_terminal.go @@ -6,7 +6,10 @@ func screenBbsTerminal() screen { title: "TERMINAL — BBS ACCESS POINT", background: BgBBSTerminal, exits: []exit{ - {label: "step back from the terminal", side: sideNear}, + { + label: "step back from the terminal", + side: sideNear, + }, }, } } diff --git a/inc/screen.exit.go b/inc/screen.exit.go index 76ac800..65fd260 100644 --- a/inc/screen.exit.go +++ b/inc/screen.exit.go @@ -38,7 +38,11 @@ type exit struct { } func toSelector() exit { - return exit{to: ScreenSelector, label: "the rest of the city", side: sideNear} + return exit{ + to: ScreenSelector, + label: "the rest of the city", + side: sideNear, + } } func exitName(to string) string { diff --git a/inc/screen.manager.go b/inc/screen.manager.go index 5e9e2f0..f21a2d3 100644 --- a/inc/screen.manager.go +++ b/inc/screen.manager.go @@ -57,8 +57,20 @@ func registerScreen(w *World) { var screenFloor = []inkwell.Polygon{ inkwell.Poly( - inkwell.Point{X: 16, Y: 196}, inkwell.Point{X: 624, Y: 196}, - inkwell.Point{X: 624, Y: 258}, inkwell.Point{X: 16, Y: 258}, + inkwell.Point{ + X: 16, + Y: 196, + }, inkwell.Point{ + X: 624, + Y: 196, + }, + inkwell.Point{ + X: 624, + Y: 258, + }, inkwell.Point{ + X: 16, + Y: 258, + }, ), } @@ -76,7 +88,13 @@ func screenBuild(w *World, s screen) inkwell.Scene { actors := s.actors if actors == nil { actors = []inkwell.SceneActor{ - {CharacterName: Paul, At: inkwell.Point{X: 320, Y: 232}}, + { + CharacterName: Paul, + At: inkwell.Point{ + X: 320, + Y: 232, + }, + }, } } walkboxes := s.walkboxes diff --git a/inc/screen.noodle_house.go b/inc/screen.noodle_house.go index 1207ba2..0aed5b3 100644 --- a/inc/screen.noodle_house.go +++ b/inc/screen.noodle_house.go @@ -7,7 +7,11 @@ func screenNoodleHouse() screen { background: BgNoodleHouse, onSelector: true, exits: []exit{ - {to: ScreenAlley, label: "the alley behind the house", side: sideRight}, + { + to: ScreenAlley, + label: "the alley behind the house", + side: sideRight, + }, }, } } diff --git a/inc/screen.norman_apartment.go b/inc/screen.norman_apartment.go index d715609..c92b56c 100644 --- a/inc/screen.norman_apartment.go +++ b/inc/screen.norman_apartment.go @@ -7,8 +7,16 @@ func screenNormanApartment() screen { background: BgNormanApartment, onSelector: true, exits: []exit{ - {to: ScreenRooftopHideout, label: "the stairs up to the roof", side: sideBack}, - {to: ScreenBBSTerminal, label: "Norman's terminal", side: sideRight}, + { + to: ScreenRooftopHideout, + label: "the stairs up to the roof", + side: sideBack, + }, + { + to: ScreenBBSTerminal, + label: "Norman's terminal", + side: sideRight, + }, }, } } diff --git a/inc/screen.paul_shop.go b/inc/screen.paul_shop.go index 01bb8cf..6ad2c89 100644 --- a/inc/screen.paul_shop.go +++ b/inc/screen.paul_shop.go @@ -6,7 +6,11 @@ func screenPaulShop() screen { title: "PAUL'S SHOP — JUNK AND GARAGE", background: BgPaulShop, exits: []exit{ - {to: ScreenNoodleHouse, label: "the bus to San Francisco", side: sideNear}, + { + to: ScreenNoodleHouse, + label: "the bus to San Francisco", + side: sideNear, + }, }, } } diff --git a/inc/screen.rooftop_hideout.go b/inc/screen.rooftop_hideout.go index 4903b3f..8cce037 100644 --- a/inc/screen.rooftop_hideout.go +++ b/inc/screen.rooftop_hideout.go @@ -6,8 +6,16 @@ func screenRooftopHideout() screen { title: "NORMAN'S ROOFTOP HIDEOUT", background: BgRooftopHideout, exits: []exit{ - {to: ScreenNormanApartment, label: "back down into the flat", side: sideNear}, - {to: ScreenBBSTerminal, label: "the old terminal", side: sideRight}, + { + to: ScreenNormanApartment, + label: "back down into the flat", + side: sideNear, + }, + { + to: ScreenBBSTerminal, + label: "the old terminal", + side: sideRight, + }, }, } } diff --git a/inc/screen.secret_club.go b/inc/screen.secret_club.go index 9a8dc74..e92f510 100644 --- a/inc/screen.secret_club.go +++ b/inc/screen.secret_club.go @@ -6,8 +6,16 @@ func screenSecretClub() screen { title: "SECRET CLUB — THE UNDERWATER SUN", background: BgSecretClub, exits: []exit{ - {to: ScreenBBSTerminal, label: "the terminal in the corner", side: sideBack}, - {to: ScreenTrinketShop, label: "back out through the shop", side: sideNear}, + { + to: ScreenBBSTerminal, + label: "the terminal in the corner", + side: sideBack, + }, + { + to: ScreenTrinketShop, + label: "back out through the shop", + side: sideNear, + }, }, } } diff --git a/inc/screen.selector.go b/inc/screen.selector.go index 64a3b9c..ace3a86 100644 --- a/inc/screen.selector.go +++ b/inc/screen.selector.go @@ -23,9 +23,8 @@ func screenSelector(rest []screen) screen { title: "SAN FRANCISCO", background: BgSelector, exits: exits, - - actors: []inkwell.SceneActor{}, - walkboxes: []inkwell.Polygon{}, + actors: []inkwell.SceneActor{}, + walkboxes: []inkwell.Polygon{}, } } diff --git a/inc/screen.small_restaurant.go b/inc/screen.small_restaurant.go index 8a84727..44a2a93 100644 --- a/inc/screen.small_restaurant.go +++ b/inc/screen.small_restaurant.go @@ -6,7 +6,11 @@ func screenSmallRestaurant() screen { title: "SMALL RESTAURANT — NEXT DOOR", background: BgSmallRestaurant, exits: []exit{ - {to: ScreenTrinketShop, label: "back to the trinket shop", side: sideLeft}, + { + to: ScreenTrinketShop, + label: "back to the trinket shop", + side: sideLeft, + }, }, } } diff --git a/inc/screen.trinket_shop.go b/inc/screen.trinket_shop.go index 695aaec..fc325ff 100644 --- a/inc/screen.trinket_shop.go +++ b/inc/screen.trinket_shop.go @@ -7,9 +7,15 @@ func screenTrinketShop() screen { background: BgTrinketShop, onSelector: true, exits: []exit{ - {to: ScreenSmallRestaurant, label: "the eating place next door", side: sideRight}, { - to: ScreenSecretClub, label: "the way in at the back", side: sideBack, + to: ScreenSmallRestaurant, + label: "the eating place next door", + side: sideRight, + }, + { + to: ScreenSecretClub, + label: "the way in at the back", + side: sideBack, needs: FlagClubEntry, blocked: "Just a shop, as far as the man behind the counter is concerned.", }, diff --git a/inc/theme.manager.go b/inc/theme.manager.go index ad823a3..b5bcc3c 100644 --- a/inc/theme.manager.go +++ b/inc/theme.manager.go @@ -12,11 +12,21 @@ const ( ) func RGB(hex uint32) color.Color { - return color.RGBA{R: uint8(hex >> 16), G: uint8(hex >> 8), B: uint8(hex), A: 0xff} + return color.RGBA{ + R: uint8(hex >> 16), + G: uint8(hex >> 8), + B: uint8(hex), + A: 0xff, + } } func RGBA(hex uint32, a uint8) color.Color { - return color.RGBA{R: uint8(hex >> 16), G: uint8(hex >> 8), B: uint8(hex), A: a} + return color.RGBA{ + R: uint8(hex >> 16), + G: uint8(hex >> 8), + B: uint8(hex), + A: a, + } } var ( @@ -31,47 +41,38 @@ var ( func realWorldTheme() inkwell.Theme { return inkwell.Theme{ - Name: RealWorld, - PanelBG: black, - StatusText: Ink, - FlashText: Amber, - - VerbButtonBG: RGB(0x1E1A14), - VerbButtonSelectedBG: AmberLo, - VerbButtonText: Ink, - + Name: RealWorld, + PanelBG: black, + StatusText: Ink, + FlashText: Amber, + VerbButtonBG: RGB(0x1E1A14), + VerbButtonSelectedBG: AmberLo, + VerbButtonText: Ink, InventorySlotBG: RGB(0x1E1A14), InventorySlotSelectedBG: AmberLo, - - SpeechBubbleBG: RGBA(0x14120E, 0xDC), - SpeechDefaultText: Ink, - - DialogBG: RGBA(0x0D0B08, 0xF0), - DialogBorder: AmberLo, - DialogChoiceBG: RGB(0x1E1A14), - DialogChoiceHover: Amber, - DialogSpeaker: Amber, - DialogText: Ink, - - EndCardBG: RGBA(0x000000, 0xFA), - EndCardText: Ink, - - CursorColor: Amber, - HotspotOutline: RGB(0x7A6A44), - SceneBackdrop: sceneBG, - - TopBarBG: panel, - TopBarText: InkDim, - TopBarAccent: Amber, - - ChatLogBG: panel, - ChatLogPrompt: InkDim, - ChatLogResponse: Amber, - ChatLogSystem: RGB(0x6B6353), - - CharacterPanelBG: panel, - CharacterPanelBorder: AmberLo, - CharacterPanelTitle: Amber, + SpeechBubbleBG: RGBA(0x14120E, 0xDC), + SpeechDefaultText: Ink, + DialogBG: RGBA(0x0D0B08, 0xF0), + DialogBorder: AmberLo, + DialogChoiceBG: RGB(0x1E1A14), + DialogChoiceHover: Amber, + DialogSpeaker: Amber, + DialogText: Ink, + EndCardBG: RGBA(0x000000, 0xFA), + EndCardText: Ink, + CursorColor: Amber, + HotspotOutline: RGB(0x7A6A44), + SceneBackdrop: sceneBG, + TopBarBG: panel, + TopBarText: InkDim, + TopBarAccent: Amber, + ChatLogBG: panel, + ChatLogPrompt: InkDim, + ChatLogResponse: Amber, + ChatLogSystem: RGB(0x6B6353), + CharacterPanelBG: panel, + CharacterPanelBorder: AmberLo, + CharacterPanelTitle: Amber, } } @@ -83,47 +84,38 @@ var ( func nokiaPunkTheme() inkwell.Theme { return inkwell.Theme{ - Name: NokiaPunk, - PanelBG: npBlack, - StatusText: Green, - FlashText: RGB(0xD8F06A), - - VerbButtonBG: RGB(0x08140A), - VerbButtonSelectedBG: GreenLo, - VerbButtonText: Green, - + Name: NokiaPunk, + PanelBG: npBlack, + StatusText: Green, + FlashText: RGB(0xD8F06A), + VerbButtonBG: RGB(0x08140A), + VerbButtonSelectedBG: GreenLo, + VerbButtonText: Green, InventorySlotBG: RGB(0x08140A), InventorySlotSelectedBG: GreenLo, - - SpeechBubbleBG: RGBA(0x030603, 0xDC), - SpeechDefaultText: Green, - - DialogBG: RGBA(0x030603, 0xF0), - DialogBorder: Green, - DialogChoiceBG: RGB(0x08140A), - DialogChoiceHover: RGB(0xB4FFC8), - DialogSpeaker: RGB(0xB4FFC8), - DialogText: Green, - - EndCardBG: RGBA(0x000000, 0xFA), - EndCardText: Green, - - CursorColor: Green, - HotspotOutline: GreenLo, - SceneBackdrop: npBlack, - - TopBarBG: RGB(0x061006), - TopBarText: GreenLo, - TopBarAccent: Green, - - ChatLogBG: RGB(0x040A04), - ChatLogPrompt: GreenLo, - ChatLogResponse: Green, - ChatLogSystem: RGB(0x156030), - - CharacterPanelBG: RGB(0x040A04), - CharacterPanelBorder: Green, - CharacterPanelTitle: RGB(0xB4FFC8), + SpeechBubbleBG: RGBA(0x030603, 0xDC), + SpeechDefaultText: Green, + DialogBG: RGBA(0x030603, 0xF0), + DialogBorder: Green, + DialogChoiceBG: RGB(0x08140A), + DialogChoiceHover: RGB(0xB4FFC8), + DialogSpeaker: RGB(0xB4FFC8), + DialogText: Green, + EndCardBG: RGBA(0x000000, 0xFA), + EndCardText: Green, + CursorColor: Green, + HotspotOutline: GreenLo, + SceneBackdrop: npBlack, + TopBarBG: RGB(0x061006), + TopBarText: GreenLo, + TopBarAccent: Green, + ChatLogBG: RGB(0x040A04), + ChatLogPrompt: GreenLo, + ChatLogResponse: Green, + ChatLogSystem: RGB(0x156030), + CharacterPanelBG: RGB(0x040A04), + CharacterPanelBorder: Green, + CharacterPanelTitle: RGB(0xB4FFC8), } } diff --git a/inc/ui.manager.go b/inc/ui.manager.go index 5e0e95c..dc1ff3f 100644 --- a/inc/ui.manager.go +++ b/inc/ui.manager.go @@ -30,57 +30,101 @@ const ( func registerUI(w *World) { g := w.G - g.UIManager.Register(&UseWithGuard{Name: "usewith_guard", W: w}) - g.UIManager.Register(&ActionPump{Name: "pump", W: w}) - g.UIManager.Register(&screenNav{Name: "screen_nav", W: w}) - g.UIManager.Register(&windowSizer{Name: "window", Scale: 2}) - g.UIManager.Register(&inkwell.HotspotDebug{Name: "hotspot_debug"}) + g.UIManager.Register(&UseWithGuard{ + Name: "usewith_guard", + W: w, + }) + g.UIManager.Register(&ActionPump{ + Name: "pump", + W: w, + }) + g.UIManager.Register(&screenNav{ + Name: "screen_nav", + W: w, + }) + g.UIManager.Register(&windowSizer{ + Name: "window", + Scale: 2, + }) + g.UIManager.Register(&inkwell.HotspotDebug{ + Name: "hotspot_debug", + }) top := &inkwell.TopBar{ - Name: "topbar", - Height: TopBarH, - + Name: "topbar", + Height: TopBarH, TimeVar: VarArmillaStrip, } w.SetTopBar(top) g.UIManager.Register(gated(w, "topbar_gate", top)) - g.UIManager.Register(&Letterbox{Name: "letterbox", W: w, Bar: 36}) - g.UIManager.Register(&hudFrame{Name: "hudframe", W: w}) + g.UIManager.Register(&Letterbox{ + Name: "letterbox", + W: w, + Bar: 36, + }) + g.UIManager.Register(&hudFrame{ + Name: "hudframe", + W: w, + }) g.UIManager.Register(gated(w, "status_gate", &inkwell.StatusLine{ - Name: "status", Y: statusY, Align: inkwell.AlignLeft, ScreenWidth: DividerX, + Name: "status", + Y: statusY, + Align: inkwell.AlignLeft, + ScreenWidth: DividerX, })) g.UIManager.Register(gated(w, "inventory_gate", &inkwell.InventoryBar{ - Name: "inventory", Origin: inkwell.Point{X: Pad + 2, Y: invY}, - Slots: 8, Cols: 4, SlotSize: invSlot, Gap: invGap, + Name: "inventory", + Origin: inkwell.Point{ + X: Pad + 2, + Y: invY, + }, + Slots: 8, + Cols: 4, + SlotSize: invSlot, + Gap: invGap, })) g.UIManager.Register(&TapeSlots{ - Name: "tapes", W: w, + Name: "tapes", + W: w, Bounds: inkwell.Rect(192, slotsY, 194, slotsH), }) g.UIManager.Register(&TapeChannel{ - Name: "channel", W: w, + Name: "channel", + W: w, Bounds: inkwell.Rect(DividerX+2, HUDTop+2, ScreenW-DividerX-4, ScreenH-HUDTop-4), }) g.UIManager.Register(&inkwell.SpeechBubble{ - Name: "speech", MaxWidth: 360, Padding: Pad, OffsetY: 8, FallbackY: TopBarH + Pad, + Name: "speech", + MaxWidth: 360, + Padding: Pad, + OffsetY: 8, + FallbackY: TopBarH + Pad, }) g.UIManager.Register(&inkwell.DialogBox{ - Name: "dialog", Bounds: inkwell.Rect(0, ScreenH-LineH*9, DividerX, LineH*9), - LineHeight: LineH, Padding: Pad, + Name: "dialog", + Bounds: inkwell.Rect(0, ScreenH-LineH*9, DividerX, LineH*9), + LineHeight: LineH, + Padding: Pad, }) g.UIManager.Register(&inkwell.RadialVerbs{ - Name: "verbs", Trigger: inkwell.MouseButtonRight, Radius: 58, + Name: "verbs", + Trigger: inkwell.MouseButtonRight, + Radius: 58, Labels: map[string]string{ "look": "Look", "use": "Use", "talk": "Talk", "take": "Take", }, }) - g.UIManager.Register(&inkwell.EndCard{Name: "endcard"}) - g.UIManager.Register(&inkwell.Cursor{Name: "cursor"}) + g.UIManager.Register(&inkwell.EndCard{ + Name: "endcard", + }) + g.UIManager.Register(&inkwell.Cursor{ + Name: "cursor", + }) } type windowSizer struct { @@ -111,7 +155,11 @@ type gate struct { } func gated(w *World, name string, inner inkwell.Widget) inkwell.Widget { - return &gate{Name: name, W: w, Inner: inner} + return &gate{ + Name: name, + W: w, + Inner: inner, + } } func (n *gate) GetName() string { return n.Name } diff --git a/inc/ui.screen_nav_test.go b/inc/ui.screen_nav_test.go index a37d603..72331be 100644 --- a/inc/ui.screen_nav_test.go +++ b/inc/ui.screen_nav_test.go @@ -9,19 +9,57 @@ import ( func TestScreenNavWrapsBothWays(t *testing.T) { g := inkwell.NewGame("t", ScreenW, ScreenH) for _, n := range []string{"a", "b", "c"} { - g.SceneManager.Register(inkwell.Scene{Name: n, Background: "bg"}) + g.SceneManager.Register(inkwell.Scene{ + Name: n, + Background: "bg", + }) } w := newWorld(g) - nav := &screenNav{Name: "screen_nav", W: w} - at := func(name string) { EnterScene(w, name).Start().Tick(&inkwell.Ctx{Game: g}) } + nav := &screenNav{ + Name: "screen_nav", + W: w, + } + at := func(name string) { + EnterScene(w, name).Start().Tick(&inkwell.Ctx{ + Game: g, + }) + } for _, tc := range []struct { from string step int want string }{ - {"a", 1, "b"}, {"b", 1, "c"}, {"c", 1, "a"}, - {"c", -1, "b"}, {"b", -1, "a"}, {"a", -1, "c"}, + { + from: "a", + step: 1, + want: "b", + }, + { + from: "b", + step: 1, + want: "c", + }, + { + from: "c", + step: 1, + want: "a", + }, + { + from: "c", + step: -1, + want: "b", + }, + { + from: "b", + step: -1, + want: "a", + }, + { + from: "a", + step: -1, + want: "c", + }, } { at(tc.from) if got := nav.neighbour(g, tc.step); got != tc.want { diff --git a/inc/ui.tape_channel.go b/inc/ui.tape_channel.go index 1e17e61..eccefaa 100644 --- a/inc/ui.tape_channel.go +++ b/inc/ui.tape_channel.go @@ -64,7 +64,10 @@ func (t *TapeChannel) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) { col, txt = th.ChatLogSystem, m.Text } for _, wl := range wrap(txt, wrapW) { - rendered = append(rendered, line{text: wl, col: col}) + rendered = append(rendered, line{ + text: wl, + col: col, + }) } } diff --git a/inc/world.action.go b/inc/world.action.go index 68b652f..13c4441 100644 --- a/inc/world.action.go +++ b/inc/world.action.go @@ -28,7 +28,10 @@ func (w *World) PumpTick(dt float64) { w.running = w.queue[0].Start() w.queue = w.queue[1:] } - ctx := &inkwell.Ctx{Game: w.G, DT: dt} + ctx := &inkwell.Ctx{ + Game: w.G, + DT: dt, + } if s, ok := w.G.SceneManager.Get(w.scene); ok { ctx.Scene = &s } @@ -59,7 +62,11 @@ func (p *ActionPump) Draw(dst *ebiten.Image, ctx *inkwell.UICtx) {} type fnAction struct{ fn func(*inkwell.Ctx) } -func (a *fnAction) Start() inkwell.Runner { return &fnRunner{spec: a} } +func (a *fnAction) Start() inkwell.Runner { + return &fnRunner{ + spec: a, + } +} type fnRunner struct{ spec *fnAction } @@ -68,7 +75,11 @@ func (r *fnRunner) Tick(ctx *inkwell.Ctx) inkwell.Status { return inkwell.StatusDone } -func Fn(f func(*inkwell.Ctx)) inkwell.Action { return &fnAction{fn: f} } +func Fn(f func(*inkwell.Ctx)) inkwell.Action { + return &fnAction{ + fn: f, + } +} func UseTheme(name string) inkwell.Action { return Fn(func(ctx *inkwell.Ctx) { ctx.Game.UseTheme(name) }) @@ -97,12 +108,19 @@ func Back(w *World) inkwell.Action { } func TapeSay(speaker, text string) inkwell.Action { - return &tapeSayAction{speaker: speaker, text: text} + return &tapeSayAction{ + speaker: speaker, + text: text, + } } type tapeSayAction struct{ speaker, text string } -func (a *tapeSayAction) Start() inkwell.Runner { return &tapeSayRunner{spec: a} } +func (a *tapeSayAction) Start() inkwell.Runner { + return &tapeSayRunner{ + spec: a, + } +} type tapeSayRunner struct { spec *tapeSayAction @@ -143,7 +161,10 @@ func (w *World) TakeTapeOffer() { } func Paused(w *World, inner inkwell.Action) inkwell.Action { - return &pausedAction{w: w, inner: inner} + return &pausedAction{ + w: w, + inner: inner, + } } type pausedAction struct { @@ -152,7 +173,10 @@ type pausedAction struct { } func (a *pausedAction) Start() inkwell.Runner { - return &pausedRunner{spec: a, inner: a.inner.Start()} + return &pausedRunner{ + spec: a, + inner: a.inner.Start(), + } } type pausedRunner struct { diff --git a/inc/world.manager.go b/inc/world.manager.go index 495b842..03166f3 100644 --- a/inc/world.manager.go +++ b/inc/world.manager.go @@ -30,7 +30,10 @@ type World struct { } func newWorld(g *inkwell.Game) *World { - return &World{G: g, mode: ModePlay} + return &World{ + G: g, + mode: ModePlay, + } } func (w *World) Mode() Mode { return w.mode }