planqi / slashdiablo-maphack

A customized maphack for the slashdiablo D2 server
GNU Affero General Public License v3.0
88 stars 42 forks source link

Issue with displaying item name as ??? when the game language is not english #73

Open UnclWish opened 4 years ago

UnclWish commented 4 years ago

In pull requests this issue described with screenshots. In any not english game language mod make item names as "???" And colors instead of color itself start to show as "y4c" before item name. It causes by different code pages when game is not english. All colors must be set like this to work properly:

define COLOR_REPLACEMENTS \

    {"WHITE", "\377c0"},                \
    {"RED", "\377c1"},                        \
    {"GREEN", "\377c2"},                \
    {"BLUE", "\377c3"},                \
    {"GOLD", "\377c4"},                \
    {"GRAY", "\377c5"},                \
    {"BLACK", "\377c6"},                \
    {"TAN", "\377c7"},                        \
    {"ORANGE", "\377c8"},                \
    {"YELLOW", "\377c9"},                \
    {"PURPLE", "\377c;"},                \
    {"DARK_GREEN", "\377c:"}

On Item.cpp must be added next to right colors on any language: for (DWORD i = 0; i < wcslen(name); i++) { if ((name[i] >= 0xFF || name[i] == 0x79) && name[i + 1] == L'c') { name[i] = L'\377'; }; } To fix "???" in item names in Constants.h for russian:

define CODE_PAGE 1251

I think it must be the way to set CODE_PAGE as system code page...

AcTiViSioN911 commented 3 years ago

Hello, could you please share your Item.cpp? I don't quite understand the line "On Item.cpp must be added next to right colors on any language".

UnclWish commented 3 years ago

Item.zip 288 string

wyntau commented 3 years ago

Same problem, can any one please to resolve?