mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-18 02:16:23 -05:00
Label fix (#931)
This commit is contained in:
parent
28a16a36e0
commit
2a36c956a4
@ -28,18 +28,18 @@ func GetLanguageLiteral(code byte) string {
|
|||||||
// Source https://github.com/eezstreet/OpenD2/blob/065f6e466048482b28b9dbc6286908dc1e0d10f6/Shared/D2Shared.hpp#L36
|
// Source https://github.com/eezstreet/OpenD2/blob/065f6e466048482b28b9dbc6286908dc1e0d10f6/Shared/D2Shared.hpp#L36
|
||||||
func getCharsets() map[string]string {
|
func getCharsets() map[string]string {
|
||||||
return map[string]string{
|
return map[string]string{
|
||||||
"ENG": "LATIN", // (English)
|
"ENG": "LATIN", // (English)
|
||||||
"ESP": "LATIN", // (Spanish)
|
"ESP": "LATIN", // (Spanish)
|
||||||
"DEU": "LATIN", // (German)
|
"DEU": "LATIN", // (German)
|
||||||
"FRA": "LATIN", // (French)
|
"FRA": "LATIN", // (French)
|
||||||
"POR": "LATIN", // (Portuguese)
|
"POR": "LATIN", // (Portuguese)
|
||||||
"ITA": "LATIN", // (Italian)
|
"ITA": "LATIN", // (Italian)
|
||||||
"JPN": "JAPAN", // (Japanese)
|
"JPN": "JPN", // (Japanese)
|
||||||
"KOR": "KOREAN", // (Korean)
|
"KOR": "KOR", // (Korean)
|
||||||
"SIN": "LATIN", //
|
"SIN": "LATIN", //
|
||||||
"CHI": "CHINESE", // (Chinese)
|
"CHI": "CHI", // (Chinese)
|
||||||
"POL": "LATIN2", // (Polish)
|
"POL": "LATIN2", // (Polish)
|
||||||
"RUS": "RUSSIAN", // (Russian)
|
"RUS": "CYR", // (Russian)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,11 @@ func (v *Label) processColorTokens(str string) string {
|
|||||||
matchToken := tokenMatch.Find(match)
|
matchToken := tokenMatch.Find(match)
|
||||||
matchStr := string(tokenMatch.ReplaceAll(match, empty))
|
matchStr := string(tokenMatch.ReplaceAll(match, empty))
|
||||||
token := ColorToken(matchToken)
|
token := ColorToken(matchToken)
|
||||||
|
|
||||||
theColor := getColor(token)
|
theColor := getColor(token)
|
||||||
|
if theColor == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if v.Color == nil {
|
if v.Color == nil {
|
||||||
v.Color = make(map[int]color.Color)
|
v.Color = make(map[int]color.Color)
|
||||||
@ -183,7 +187,7 @@ func getColor(token ColorToken) color.Color {
|
|||||||
chosen := colors[token]
|
chosen := colors[token]
|
||||||
|
|
||||||
if chosen == nil {
|
if chosen == nil {
|
||||||
return colors[ColorTokenWhite]
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return chosen
|
return chosen
|
||||||
|
Loading…
Reference in New Issue
Block a user