1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-05 23:40:43 +00:00
OpenDiablo2/d2core/d2ui/d2ui.go
Julien Ganichot 0d691dbffa
Key binding menu (#918)
* Feat(KeyBindingMenu): Adds dynamic box system with scrollbar

* Feat(Hotkeys): WIP Adds a lot of things

* Feat(KeyBindingMenu): WIP Adds logic to binding

* Feat(KeyBindingMenu): Fixes assignment logic

* Feat(KeyBindingMenu): Adds buttons logic

* Feat(KeyBindingMenu): Fixes sprites positions+add padding to Box

* Feat(KeyBindingMenu): Adds label blinking cap

* Feat(KeyBindingMenu): Removes commented func

* Feat(KeyBindingMenu): Fixes lint errors and refactors a bit

* Feat(KeyBindingMenu): Corrects few minor things from Grave

* Feat(KeyBindingMenu): removes forgotten key to string mapping
2020-11-13 12:03:30 -08:00

44 lines
1007 B
Go

package d2ui
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2asset"
)
// 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
)
// HorizontalAlign type, determines alignment along x-axis within a layout
type HorizontalAlign int
// Horizontal alignment types
const (
HorizontalAlignLeft HorizontalAlign = iota
HorizontalAlignCenter
HorizontalAlignRight
)
// NewUIManager creates a UIManager instance with the given input and audio provider
func NewUIManager(
asset *d2asset.AssetManager,
renderer d2interface.Renderer,
input d2interface.InputManager,
audio d2interface.AudioProvider,
) *UIManager {
ui := &UIManager{
asset: asset,
renderer: renderer,
inputManager: input,
audio: audio,
}
return ui
}