1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-16 04:25:23 +00:00

Label fix (#931)

This commit is contained in:
Michał Mrówka 2020-11-18 08:50:31 +01:00 committed by GitHub
parent 28a16a36e0
commit 2a36c956a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -34,12 +34,12 @@ func getCharsets() map[string]string {
"FRA": "LATIN", // (French)
"POR": "LATIN", // (Portuguese)
"ITA": "LATIN", // (Italian)
"JPN": "JAPAN", // (Japanese)
"KOR": "KOREAN", // (Korean)
"JPN": "JPN", // (Japanese)
"KOR": "KOR", // (Korean)
"SIN": "LATIN", //
"CHI": "CHINESE", // (Chinese)
"CHI": "CHI", // (Chinese)
"POL": "LATIN2", // (Polish)
"RUS": "RUSSIAN", // (Russian)
"RUS": "CYR", // (Russian)
}
}

View File

@ -133,7 +133,11 @@ func (v *Label) processColorTokens(str string) string {
matchToken := tokenMatch.Find(match)
matchStr := string(tokenMatch.ReplaceAll(match, empty))
token := ColorToken(matchToken)
theColor := getColor(token)
if theColor == nil {
continue
}
if v.Color == nil {
v.Color = make(map[int]color.Color)
@ -183,7 +187,7 @@ func getColor(token ColorToken) color.Color {
chosen := colors[token]
if chosen == nil {
return colors[ColorTokenWhite]
return nil
}
return chosen