2020-02-17 22:11:52 -05:00
|
|
|
package d2gui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
type FontStyle int
|
|
|
|
|
|
|
|
const (
|
|
|
|
FontStyle16Units FontStyle = iota
|
|
|
|
FontStyle30Units
|
|
|
|
FontStyle42Units
|
2020-02-24 22:35:21 -05:00
|
|
|
FontStyleExocet10
|
2020-02-17 22:11:52 -05:00
|
|
|
FontStyleFormal10Static
|
|
|
|
FontStyleFormal11Units
|
|
|
|
FontStyleFormal12Static
|
2020-02-24 22:35:21 -05:00
|
|
|
FontStyleRediculous
|
2020-02-17 22:11:52 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type fontStyleConfig struct {
|
|
|
|
fontBasePath string
|
|
|
|
palettePath string
|
|
|
|
}
|
|
|
|
|
|
|
|
var fontStyleConfigs = map[FontStyle]fontStyleConfig{
|
|
|
|
FontStyle16Units: {d2resource.Font16, d2resource.PaletteUnits},
|
|
|
|
FontStyle30Units: {d2resource.Font30, d2resource.PaletteUnits},
|
|
|
|
FontStyle42Units: {d2resource.Font42, d2resource.PaletteUnits},
|
2020-02-24 22:35:21 -05:00
|
|
|
FontStyleExocet10: {d2resource.FontExocet10, d2resource.PaletteUnits},
|
2020-02-17 22:11:52 -05:00
|
|
|
FontStyleFormal10Static: {d2resource.FontFormal10, d2resource.PaletteStatic},
|
|
|
|
FontStyleFormal11Units: {d2resource.FontFormal11, d2resource.PaletteUnits},
|
|
|
|
FontStyleFormal12Static: {d2resource.FontFormal12, d2resource.PaletteStatic},
|
2020-02-24 22:35:21 -05:00
|
|
|
FontStyleRediculous: {d2resource.FontRediculous, d2resource.PaletteUnits},
|
2020-02-17 22:11:52 -05:00
|
|
|
}
|
|
|
|
|
2020-02-24 22:35:21 -05:00
|
|
|
type ButtonStyle int
|
|
|
|
|
|
|
|
type buttonStyleConfig struct {
|
|
|
|
segmentsX int
|
|
|
|
segmentsY int
|
|
|
|
animationPath string
|
|
|
|
palettePath string
|
|
|
|
fontStyle FontStyle
|
|
|
|
textOffset int
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
ButtonStyleMedium ButtonStyle = iota
|
|
|
|
ButtonStyleNarrow
|
|
|
|
ButtonStyleOkCancel
|
|
|
|
ButtonStyleShort
|
|
|
|
ButtonStyleTall
|
|
|
|
ButtonStyleWide
|
|
|
|
)
|
|
|
|
|
|
|
|
var buttonStyleConfigs = map[ButtonStyle]buttonStyleConfig{
|
|
|
|
ButtonStyleMedium: {1, 1, d2resource.MediumButtonBlank, d2resource.PaletteUnits, FontStyleExocet10, 0},
|
|
|
|
ButtonStyleOkCancel: {1, 1, d2resource.CancelButton, d2resource.PaletteUnits, FontStyleRediculous, 0},
|
|
|
|
ButtonStyleShort: {1, 1, d2resource.ShortButtonBlank, d2resource.PaletteUnits, FontStyleRediculous, -1},
|
|
|
|
ButtonStyleTall: {1, 1, d2resource.TallButtonBlank, d2resource.PaletteUnits, FontStyleExocet10, 5},
|
|
|
|
ButtonStyleWide: {2, 1, d2resource.WideButtonBlank, d2resource.PaletteUnits, FontStyleExocet10, 1},
|
2020-02-17 22:11:52 -05:00
|
|
|
}
|