fixed lint errors

This commit is contained in:
M. Sz 2020-11-26 11:30:11 +01:00
parent 76257ca351
commit 1dcd63a238
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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