mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-04 07:37:48 -05:00
acc4c7a13e
* fixed lint errors in button.go * fixed lint errors in checkbox.go * Removed d2ui singleton, fixed nearly all lint errors - Changed `UI` struct to `UIManager`, removed singleton - UI element provider functions are now methods of the UI Manager - Screens now use the UI manager to create UI elements - game panels in d2player now use the UI Manager to create UI elements - Only the UI manager knows about "widgets"; calls to `d2ui.AddWidget` in Screen instances have been removed * changed ui element provider methods from `Create` to `New`
31 lines
670 B
Go
31 lines
670 B
Go
package d2ui
|
|
|
|
import (
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
|
|
)
|
|
|
|
// CursorButton represents a mouse button
|
|
type CursorButton uint8
|
|
|
|
const (
|
|
// CursorButtonLeft represents the left mouse button
|
|
CursorButtonLeft CursorButton = 1
|
|
// CursorButtonRight represents the right mouse button
|
|
CursorButtonRight CursorButton = 2
|
|
)
|
|
|
|
// NewUIManager creates a UIManager instance with the given input and audio provider
|
|
func NewUIManager(
|
|
renderer d2interface.Renderer,
|
|
input d2interface.InputManager,
|
|
audio d2interface.AudioProvider,
|
|
) *UIManager {
|
|
ui := &UIManager{
|
|
renderer: renderer,
|
|
inputManager: input,
|
|
audio: audio,
|
|
}
|
|
|
|
return ui
|
|
}
|