1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-02 17:27:23 -04:00
OpenDiablo2/d2common/d2interface/terminal.go
dk 60e6fcb7ac
moving enumerations out of d2interface (#552)
* moved filter constants back to d2enum

* moving key and mouse button enums into d2enum

* moving render type enum into d2enum

* moving input even priority enums into d2enum

* moving terminal enums into d2enum
2020-07-06 21:26:08 -04:00

34 lines
1.0 KiB
Go

package d2interface
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
// Terminal is a drop-down terminal and shell
// It is used throughout the codebase, most parts of the engine will
// `bind` commands, which are available for use in the shell
type Terminal interface {
BindLogger()
Advance(elapsed float64) error
OnKeyDown(event KeyEvent) bool
OnKeyChars(event KeyCharsEvent) bool
Render(surface Surface) error
Execute(command string) error
OutputRaw(text string, category d2enum.TermCategory)
Outputf(format string, params ...interface{})
OutputInfof(format string, params ...interface{})
OutputWarningf(format string, params ...interface{})
OutputErrorf(format string, params ...interface{})
OutputClear()
IsVisible() bool
Hide()
Show()
BindAction(name, description string, action interface{}) error
UnbindAction(name string) error
}
// TerminalLogger is used tomake the Terminal write out
// (eg. to the system shell or to a file)
type TerminalLogger interface {
Write(p []byte) (int, error)
}