2020-06-13 20:36:20 -04:00
|
|
|
package d2screen
|
|
|
|
|
|
|
|
import (
|
2020-06-29 00:41:58 -04:00
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
|
2020-06-13 20:36:20 -04:00
|
|
|
)
|
|
|
|
|
2020-07-01 08:59:24 -04:00
|
|
|
// Screen is an exported interface
|
2020-06-13 20:36:20 -04:00
|
|
|
type Screen interface{}
|
|
|
|
|
2020-07-01 08:59:24 -04:00
|
|
|
// ScreenLoadHandler is an exported interface
|
2020-06-13 20:36:20 -04:00
|
|
|
type ScreenLoadHandler interface {
|
2020-06-24 18:46:03 -04:00
|
|
|
// OnLoad performs all necessary loading to prepare a screen to be shown such as loading assets, placing and binding
|
|
|
|
// of ui elements, etc. This loading is done asynchronously. The provided channel will allow implementations to
|
|
|
|
// provide progress via Error, Progress, or Done
|
|
|
|
OnLoad(loading LoadingState)
|
2020-06-13 20:36:20 -04:00
|
|
|
}
|
|
|
|
|
2020-07-01 08:59:24 -04:00
|
|
|
// ScreenUnloadHandler is an exported interface
|
2020-06-13 20:36:20 -04:00
|
|
|
type ScreenUnloadHandler interface {
|
|
|
|
OnUnload() error
|
|
|
|
}
|
|
|
|
|
2020-07-01 08:59:24 -04:00
|
|
|
// ScreenRenderHandler is an exported interface
|
2020-06-13 20:36:20 -04:00
|
|
|
type ScreenRenderHandler interface {
|
2020-10-28 14:17:42 -04:00
|
|
|
Render(target d2interface.Surface)
|
2020-06-13 20:36:20 -04:00
|
|
|
}
|
|
|
|
|
2020-07-01 08:59:24 -04:00
|
|
|
// ScreenAdvanceHandler is an exported interface
|
2020-06-13 20:36:20 -04:00
|
|
|
type ScreenAdvanceHandler interface {
|
|
|
|
Advance(elapsed float64) error
|
|
|
|
}
|