diff --git a/Common/Sounds.go b/Common/Sounds.go index 6c80676f..711723e6 100644 --- a/Common/Sounds.go +++ b/Common/Sounds.go @@ -94,5 +94,5 @@ func LoadSounds(fileProvider FileProvider) { } */ } - log.Println("Loaded %d sound definitions", len(Sounds)) + log.Printf("Loaded %d sound definitions", len(Sounds)) } diff --git a/Common/StringUtils.go b/Common/StringUtils.go index 9b00ee5c..eb4fb9b5 100644 --- a/Common/StringUtils.go +++ b/Common/StringUtils.go @@ -65,6 +65,10 @@ func Utf16BytesToString(b []byte) (string, error) { return ret.String(), nil } +func CombineStrings(input []string) string { + return strings.Join(input, "\n") +} + func SplitIntoLinesWithMaxWidth(fullSentence string, maxChars int) []string { lines := make([]string, 0) line := "" diff --git a/Scenes/CharacterSelect.go b/Scenes/CharacterSelect.go index 1eb4edad..dc3026b0 100644 --- a/Scenes/CharacterSelect.go +++ b/Scenes/CharacterSelect.go @@ -45,31 +45,31 @@ func (v *CharacterSelect) Load() []func() { v.background.MoveTo(0, 0) }, func() { - v.newCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, "CREATE NEW\nCHARACTER") + v.newCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, Common.CombineStrings(Common.SplitIntoLinesWithMaxWidth(Common.TranslateString("#831"), 13))) v.newCharButton.MoveTo(33, 468) v.newCharButton.OnActivated(func() { v.onNewCharButtonClicked() }) v.uiManager.AddWidget(v.newCharButton) }, func() { - v.convertCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, "CONVERT TO\nEXPANSION") + v.convertCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, Common.CombineStrings(Common.SplitIntoLinesWithMaxWidth(Common.TranslateString("#825"), 13))) v.convertCharButton.MoveTo(233, 468) v.convertCharButton.SetEnabled(false) v.uiManager.AddWidget(v.convertCharButton) }, func() { - v.deleteCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, "DELETE\nCHARACTER") + v.deleteCharButton = UI.CreateButton(UI.ButtonTypeTall, v.fileProvider, Common.CombineStrings(Common.SplitIntoLinesWithMaxWidth(Common.TranslateString("#832"), 13))) v.deleteCharButton.MoveTo(433, 468) v.deleteCharButton.SetEnabled(false) v.uiManager.AddWidget(v.deleteCharButton) }, func() { - v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, "EXIT") + v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, Common.TranslateString("#970")) v.exitButton.MoveTo(33, 537) v.exitButton.OnActivated(func() { v.onExitButtonClicked() }) v.uiManager.AddWidget(v.exitButton) }, func() { - v.okButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, "OK") + v.okButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, Common.TranslateString("#971")) v.okButton.MoveTo(625, 537) v.okButton.SetEnabled(false) v.uiManager.AddWidget(v.okButton) diff --git a/Scenes/Credits.go b/Scenes/Credits.go index cb13130e..0c03b02e 100644 --- a/Scenes/Credits.go +++ b/Scenes/Credits.go @@ -56,7 +56,7 @@ func (v *Credits) Load() []func() { v.creditsBackground.MoveTo(0, 0) }, func() { - v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, "EXIT") + v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, Common.TranslateString("#970")) v.exitButton.MoveTo(30, 550) v.exitButton.OnActivated(func() { v.onExitButtonClicked() }) v.uiManager.AddWidget(v.exitButton) diff --git a/Scenes/SelectHeroClass.go b/Scenes/SelectHeroClass.go index 1f6e0fc7..1213b919 100644 --- a/Scenes/SelectHeroClass.go +++ b/Scenes/SelectHeroClass.go @@ -109,7 +109,7 @@ func (v *SelectHeroClass) Load() []func() { v.campfire.Animate = true }, func() { - v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, "EXIT") + v.exitButton = UI.CreateButton(UI.ButtonTypeMedium, v.fileProvider, Common.TranslateString("#970")) v.exitButton.MoveTo(33, 537) v.exitButton.OnActivated(func() { v.onExitButtonClicked() }) v.uiManager.AddWidget(v.exitButton)