2020-01-25 23:28:21 -05:00
|
|
|
package d2term
|
|
|
|
|
|
|
|
import (
|
2020-01-31 23:18:11 -05:00
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2input"
|
2020-01-25 23:28:21 -05:00
|
|
|
)
|
|
|
|
|
2020-06-28 21:40:52 -04:00
|
|
|
func Initialize() (*terminal, error) {
|
2020-01-25 23:28:21 -05:00
|
|
|
|
2020-06-28 21:40:52 -04:00
|
|
|
term, err := createTerminal()
|
2020-01-25 23:28:21 -05:00
|
|
|
if err != nil {
|
2020-06-28 21:40:52 -04:00
|
|
|
return nil, err
|
2020-01-25 23:28:21 -05:00
|
|
|
}
|
|
|
|
|
2020-06-28 21:40:52 -04:00
|
|
|
if err := d2input.BindHandlerWithPriority(term, d2input.PriorityHigh); err != nil {
|
|
|
|
return nil, err
|
2020-02-09 14:12:04 -05:00
|
|
|
}
|
|
|
|
|
2020-06-28 21:40:52 -04:00
|
|
|
return term, nil
|
2020-02-09 14:12:04 -05:00
|
|
|
}
|