diff --git a/domain/dialog.go b/domain/dialog.go index adccba5..fd6796c 100644 --- a/domain/dialog.go +++ b/domain/dialog.go @@ -2,20 +2,13 @@ package domain import ( "game/konstructor/entity" - "image/color" ) func (d *Domain) InitDialog() { d.DialogMap = entity.DialogMap{ "TestDialog": { Layout: entity.DialogLayout{ - ChoiceFont: entity.FontLayout{ - Path: "fonts/Arial.ttf", - DPI: 72, - Size: 24, - Color: color.White, - SelectedColor: color.RGBA{R: 0, G: 255, B: 0, A: 100}, - }, + ChoiceFont: GetDefaultFontLayout(), }, Choices: []entity.DialogChoice{ { diff --git a/domain/font.go b/domain/font.go new file mode 100644 index 0000000..5423507 --- /dev/null +++ b/domain/font.go @@ -0,0 +1,16 @@ +package domain + +import ( + "game/konstructor/entity" + "image/color" +) + +func GetDefaultFontLayout() entity.FontLayout { + return entity.FontLayout{ + Path: "fonts/ArcadeClassic.ttf", + DPI: 72, + Size: 24, + Color: color.White, + SelectedColor: color.RGBA{R: 255, G: 0, B: 0, A: 100}, + } +} diff --git a/domain/menu.go b/domain/menu.go index 5d2e25e..47261e6 100644 --- a/domain/menu.go +++ b/domain/menu.go @@ -3,7 +3,6 @@ package domain import ( "fmt" "game/konstructor/entity" - "image/color" "os" ) @@ -12,13 +11,7 @@ func (d *Domain) InitMenu() { "MainMenu": { CurrentSelected: 0, Layout: entity.MenuLayout{ - MenuItemFont: entity.FontLayout{ - Path: "fonts/Arial.ttf", - DPI: 72, - Size: 24, - Color: color.White, - SelectedColor: color.RGBA{R: 0, G: 255, B: 0, A: 100}, - }, + MenuItemFont: GetDefaultFontLayout(), }, MenuItems: []entity.MenuItem{ { @@ -41,13 +34,7 @@ func (d *Domain) InitMenu() { "GameMenu": { CurrentSelected: 0, Layout: entity.MenuLayout{ - MenuItemFont: entity.FontLayout{ - Path: "fonts/Arial.ttf", - DPI: 72, - Size: 24, - Color: color.White, - SelectedColor: color.RGBA{R: 0, G: 255, B: 0, A: 100}, - }, + MenuItemFont: GetDefaultFontLayout(), }, MenuItems: []entity.MenuItem{ { diff --git a/fonts/ArcadeClassic.ttf b/fonts/ArcadeClassic.ttf new file mode 100644 index 0000000..394a9f7 Binary files /dev/null and b/fonts/ArcadeClassic.ttf differ