static const DWORD func_text_y_old=0x004D58DC;
static void _declspec(naked) func_text_main_menu_y() {
_asm {
call func_text_y_old;
mov esi,0x0;
mov edi,26; // 26 - y offset
retn;
}
}
static const DWORD func_buttons_y_old=0x004e0d37;
static void _declspec(naked) func_buttons_main_menu_y() {
_asm {
call func_buttons_y_old;
mov esi,0x0;
mov ebp,0x19;
retn;
}
}
int buttons_number_main_menu=GetPrivateProfileInt("TWILIGHT WORLD", "buttons_number_main_menu", -1, ini);
if(buttons_number_main_menu!=-1) {
if(*((DWORD*)0x4818BB) != 0xB88C7C06) return false;
SafeWrite8(0x4818BB, buttons_number_main_menu); // number of buttons in main menu
SafeWrite8(0x48193F, buttons_number_main_menu); // number of text strings in main menu
}
int text_main_menu=GetPrivateProfileInt("TWILIGHT WORLD", "text_main_menu", -1, ini);
if(text_main_menu!=-1) {
SafeWrite32(0x4818FA, 526); // 526 - x offset
SafeWrite32(0x004818C4, ((DWORD)&func_text_main_menu_y) - 0x004818C8);
SafeWrite32(0x004818C8, 0x90909090);
}
int events_main_menu=GetPrivateProfileInt("TWILIGHT WORLD", "events_main_menu", -1, ini);
if(events_main_menu!=-1) {
SafeWrite8(0x519510, 0x6E);
SafeWrite8(0x519514, 0x6C);
SafeWrite8(0x519518, 0x6F);
SafeWrite8(0x51951c, 0x63);
SafeWrite8(0x519520, 0x65);
SafeWrite8(0x519528, 0x01);
SafeWrite8(0x51952c, 0x02);
SafeWrite8(0x519530, 0x09);
SafeWrite8(0x519534, 0x05);
SafeWrite8(0x519538, 0x07);
SafeWrite8(0x481b5F, 0x03);
}
int buttons_main_menu=GetPrivateProfileInt("TWILIGHT WORLD", "buttons_main_menu", -1, ini);
if(buttons_main_menu!=-1) {
SafeWrite32(0x48187C, 428);
SafeWrite32(0x00481840, ((DWORD)&func_buttons_main_menu_y) - 0x00481844);
SafeWrite32(0x00481846, 0x90909090);
}