exceptions

package
v0.0.0-...-79996cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package exceptions handles JavaScript errors nicely for the game.

Index

Constants

This section is empty.

Variables

View Source
var (
	Supervisor *ui.Supervisor
	Window     *ui.Window
	Disabled   bool // don't reopen the window again

)

The exception catching window is a singleton and appears on top with its own supervisor apart from whatever the game is currently doing.

Functions

func Catch

func Catch(exc string, args ...interface{})

Catch a JavaScript exception and maybe show it to the user.

func Draw

func Draw(e render.Engine)

Loop allows the exception window to appear on game tick.

func Handled

func Handled(ev *event.State) bool

Handled returns true if the exception window handles the events this tick, e.g. so clicking on its window won't let your mouse click also hit things behind it.

func MakeWindow

func MakeWindow(cfg Exception) *ui.Window

MakeWindow initializes the window.

func Setup

func Setup()

Setup the global supervisor and window the first time - after the render engine has initialized, e.g., when you want the window to show up the first time.

func Teardown

func Teardown()

Teardown the exception UI, if it was loaded. This is done between Scene transitions in the game to reduce memory leaks in case the scenes will flush SDL2 caches or w/e.

Types

type Exception

type Exception struct {
	// Settings passed in by doodle
	Supervisor *ui.Supervisor
	Engine     render.Engine
}

Exception window to show scripting errors in doodads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL