mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-03 15:17:04 -05:00
0d691dbffa
* 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
44 lines
1007 B
Go
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
|
|
}
|