From 1dcd63a238a7e1926ac447222f017afd37eb7a09 Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Thu, 26 Nov 2020 11:30:11 +0100 Subject: [PATCH] fixed lint errors --- d2common/d2resource/languages_map.go | 2 +- d2core/d2asset/asset_manager.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/d2common/d2resource/languages_map.go b/d2common/d2resource/languages_map.go index 617b21f3..44045a17 100644 --- a/d2common/d2resource/languages_map.go +++ b/d2common/d2resource/languages_map.go @@ -50,6 +50,7 @@ func GetFontCharset(language string) string { return charset[language] } +// GetLabelModifier returns modifier for language /* modifiers for labels (used in string tables) modifier is something like that: english table: polish table: @@ -62,7 +63,6 @@ So, GetLabelModifier returns value of offset in locale languages table */ // some of values need to be set up. For now values with "checked" comment // was tested and works fine in main menu. -// GetLabelModifier returns modifier for language func GetLabelModifier(language string) int { modifiers := map[string]int{ "ENG": 0, // (English) // checked diff --git a/d2core/d2asset/asset_manager.go b/d2core/d2asset/asset_manager.go index 079bee07..2ab2ab27 100644 --- a/d2core/d2asset/asset_manager.go +++ b/d2core/d2asset/asset_manager.go @@ -126,6 +126,7 @@ func (am *AssetManager) LoadLanguage(languagePath string) string { am.Infof("Language: %s", language) am.language = language + return language } @@ -303,7 +304,7 @@ func (am *AssetManager) TranslateString(input interface{}) string { return key } -func (a *AssetManager) baseLabelNumbers(idx int) int { +func (am *AssetManager) baseLabelNumbers(idx int) int { baseLabelNumbers := []int{ // main menu labels 1612, // CANCEL @@ -369,8 +370,8 @@ func (a *AssetManager) baseLabelNumbers(idx int) int { } // TranslateLabel translates the label taking into account its shift in the table -func (a *AssetManager) TranslateLabel(label int) string { - return a.TranslateString(fmt.Sprintf("#%d", a.baseLabelNumbers(label+d2resource.GetLabelModifier(a.language)))) +func (am *AssetManager) TranslateLabel(label int) string { + return am.TranslateString(fmt.Sprintf("#%d", am.baseLabelNumbers(label+d2resource.GetLabelModifier(am.language)))) } // LoadPaletteTransform loads a palette transform file