mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed broken object descriptions for Chinese version
Minor code edits.
This commit is contained in:
@@ -20,7 +20,7 @@ VAR_(btncnt, DWORD)
|
||||
VARD(cap, fo::AIcap) // dynamic array
|
||||
VAR_(carCurrentArea, DWORD)
|
||||
VAR_(carGasAmount, long) // from 0 to 80000
|
||||
VAR_(cmap, DWORD)
|
||||
VARA(cmap, fo::PALETTE, 256)
|
||||
VAR_(colorTable, DWORD)
|
||||
VAR_(combat_end_due_to_load, DWORD)
|
||||
VAR_(combat_free_move, DWORD)
|
||||
|
||||
@@ -173,7 +173,7 @@ static void __declspec(naked) sf_inven_display_msg() {
|
||||
void Text::init() {
|
||||
// Support for the newline control character '\n' in the object description in pro_*.msg files
|
||||
void* printFunc = sf_display_print; // for vanilla and HRP 4.1.8
|
||||
if (sf::hrpIsEnabled && !sf::hrpVersionValid) {
|
||||
if (sf::versionCHI || (sf::hrpIsEnabled && !sf::hrpVersionValid)) {
|
||||
printFunc = sf_display_print_alt;
|
||||
}
|
||||
sf::SafeWriteBatch<DWORD>((DWORD)printFunc, {0x46ED87, 0x49AD7A}); // setup_inventory_, obj_examine_
|
||||
|
||||
@@ -372,9 +372,7 @@ static void DrawFPS() {}
|
||||
#endif
|
||||
|
||||
static void Present() {
|
||||
if ((moveWindowKey[0] != 0 && KeyDown(moveWindowKey[0])) ||
|
||||
(moveWindowKey[1] != 0 && KeyDown(moveWindowKey[1])))
|
||||
{
|
||||
if (moveWindowKey[0] != 0 && (KeyDown(moveWindowKey[0]) || (moveWindowKey[1] != 0 && KeyDown(moveWindowKey[1])))) {
|
||||
int mx, my;
|
||||
GetMouse(&mx, &my);
|
||||
windowLeft += mx;
|
||||
|
||||
@@ -93,6 +93,8 @@ namespace sfall
|
||||
|
||||
bool isDebug = false;
|
||||
|
||||
bool versionCHI = false;
|
||||
|
||||
bool hrpIsEnabled = false;
|
||||
bool hrpVersionValid = false; // HRP 4.1.8 version validation
|
||||
|
||||
@@ -273,6 +275,8 @@ defaultIni:
|
||||
IniReader::SetDefaultConfigFile();
|
||||
}
|
||||
|
||||
versionCHI = (*(DWORD*)0x4CAF23 == 0x225559); // check if the exe is modified for Chinese support
|
||||
|
||||
hrpIsEnabled = (*(DWORD*)0x4E4480 != 0x278805C7); // check if HRP is enabled
|
||||
if (hrpIsEnabled) {
|
||||
GetHRPModule();
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace sfall
|
||||
#define pushadc __asm push eax __asm push edx __asm push ecx
|
||||
#define popadc __asm pop ecx __asm pop edx __asm pop eax
|
||||
|
||||
extern bool versionCHI;
|
||||
|
||||
extern bool hrpIsEnabled;
|
||||
extern bool hrpVersionValid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user