comparison mm7_5.cpp @ 369:6e984a4a896f

GameMenu fix
author Ritor1
date Fri, 22 Feb 2013 14:47:17 +0600
parents 0f35f908547f
children d1d1e1daa7f7
comparison
equal deleted inserted replaced
368:df09db095ef1 369:6e984a4a896f
384 { 384 {
385 //Actor::Actor(&actor); 385 //Actor::Actor(&actor);
386 memset(&actor, 0, 0x344u); 386 memset(&actor, 0, 0x344u);
387 actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx; 387 actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx;
388 pActor = &actor; 388 pActor = &actor;
389 //_actor_init_dlg:
390 pActor->InitializeDialogue(v0); 389 pActor->InitializeDialogue(v0);
391 } 390 }
392 } 391 }
393 continue; 392 continue;
394 case UIMSG_51: 393 case UIMSG_51:
413 pIcons_LOD->_4114F2(); 412 pIcons_LOD->_4114F2();
414 if ( pMessageQueue_50CBD0->uNumMessages ) 413 if ( pMessageQueue_50CBD0->uNumMessages )
415 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 414 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
416 pGUIWindow_CurrentMenu->Release(); 415 pGUIWindow_CurrentMenu->Release();
417 uGameState = 4; 416 uGameState = 4;
418 LABEL_188:
419 pCurrentScreen = SCREEN_GAME; 417 pCurrentScreen = SCREEN_GAME;
420 viewparams->bRedrawGameUI = v0; 418 viewparams->bRedrawGameUI = v0;
421 } 419 }
422 else 420 else
423 { 421 {
424 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game" 422 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game"
425 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); 423 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
426 dword_6BE138 = 124; 424 dword_6BE138 = 124;
427 } 425 }
428 //_release_tex_and_continue:
429 stru_506E40.Release(); 426 stru_506E40.Release();
430 continue; 427 continue;
431 case UIMSG_Game_OpenLoadGameDialog: 428 case UIMSG_Game_OpenLoadGameDialog:
432 pIcons_LOD->_40F9C5(); 429 pIcons_LOD->_40F9C5();
433 pIcons_LOD->_4114F2(); 430 pIcons_LOD->_4114F2();
451 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); 448 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
452 uGameState = 7; 449 uGameState = 7;
453 } 450 }
454 else 451 else
455 { 452 {
456 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2u);// "Are you sure? Click again to quit" 453 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
457 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); 454 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
458 dword_6BE138 = 132; 455 dword_6BE138 = 132;
459 } 456 }
460 //goto _release_tex_and_continue;
461 stru_506E40.Release(); 457 stru_506E40.Release();
462 continue; 458 continue;
463 case UIMSG_80: 459 case UIMSG_80:
464 pIcons_LOD->_40F9C5(); 460 pIcons_LOD->_40F9C5();
465 pIcons_LOD->_4114F2(); 461 pIcons_LOD->_4114F2();
466 pGUIWindow_CurrentMenu->Release(); 462 pGUIWindow_CurrentMenu->Release();
467 pCurrentScreen = SCREEN_OPTIONS; 463 pCurrentScreen = SCREEN_OPTIONS;
468 v162 = 0; 464 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (WindowType)8, 0, 0);
469 v148 = 0;
470 pWindowType = (WindowType)8;
471 //goto LABEL_439;
472 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162);
473 continue; 465 continue;
474 case UIMSG_ArrowUp: 466 case UIMSG_ArrowUp:
475 --pSaveListPosition; 467 --pSaveListPosition;
476 if ( pSaveListPosition < 0 ) 468 if ( pSaveListPosition < 0 )
477 pSaveListPosition = 0; 469 pSaveListPosition = 0;
478 v163 = 0; 470 GUIWindow::Create(215, 199, 17, 17, (WindowType)90, (int)pBtnArrowUp, 0);
479 v8 = 199;
480 pButton2 = pBtnArrowUp;
481 //goto LABEL_60;
482 pWindowType1 = (WindowType)90;
483 v137 = 17;
484 v133 = 17;
485 v9 = 215;
486 //goto LABEL_733;
487 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
488 continue; 471 continue;
489 case UIMSG_DownArrow: 472 case UIMSG_DownArrow:
490 ++pSaveListPosition; 473 ++pSaveListPosition;
491 if ( pSaveListPosition >= uMessageParam ) 474 if ( pSaveListPosition >= uMessageParam )
492 pSaveListPosition = uMessageParam - 1; 475 pSaveListPosition = uMessageParam - 1;
493 v163 = 0; 476 GUIWindow::Create(215, 323, 17, 17, (WindowType)90, (int)pBtnDownArrow, 0);
494 v8 = 323;
495 pButton2 = pBtnDownArrow;
496 //LABEL_60:
497 pWindowType1 = (WindowType)90;
498 v137 = 17;
499 v133 = 17;
500 v9 = 215;
501 //goto LABEL_733;
502 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
503 continue; 477 continue;
504 case UIMSG_Cancel: 478 case UIMSG_Cancel:
505 v163 = 0; 479 GUIWindow::Create(350, 302, 106, 42, (WindowType)96, (int)pBtnCancel, 0);
506 v8 = 302;
507 pButton2 = pBtnCancel;
508 v9 = 350;
509 pWindowType1 = (WindowType)96;
510 v137 = 42;
511 v133 = 106;
512 //goto LABEL_733;
513 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
514 continue; 480 continue;
515 case UIMSG_LoadSlot: 481 case UIMSG_LoadSlot:
516 v163 = 0; 482 GUIWindow::Create(241, 302, 106, 42, (WindowType)94, (int)pBtnLoadSlot, 0);
517 v8 = 302;
518 pButton2 = pBtnLoadSlot;
519 v9 = 241;
520 pWindowType1 = (WindowType)94;
521 v137 = 42;
522 v133 = 106;
523 //goto LABEL_733;
524 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
525 continue; 483 continue;
526 case UIMSG_SelectLoadSlot: 484 case UIMSG_SelectLoadSlot:
527 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 485 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
528 pKeyActionMap->_459ED1(0); 486 pKeyActionMap->_459ED1(0);
529 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) 487 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
564 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) 522 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
565 { 523 {
566 LoadGame(uLoadGameUI_SelectedSlot); 524 LoadGame(uLoadGameUI_SelectedSlot);
567 uGameState = 3; 525 uGameState = 3;
568 } 526 }
569 //goto _release_tex_and_continue;
570 stru_506E40.Release(); 527 stru_506E40.Release();
571 continue; 528 continue;
572 case UIMSG_SaveGame: 529 case UIMSG_SaveGame:
573 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 530 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
574 { 531 {
575 pKeyActionMap->_459ED1(0); 532 pKeyActionMap->_459ED1(0);
576 strcpy( 533 strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer);
577 (char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot,
578 (const char *)pKeyActionMap->pPressedKeysBuffer);
579 } 534 }
580 DoSavegame(uLoadGameUI_SelectedSlot); 535 DoSavegame(uLoadGameUI_SelectedSlot);
581 //goto _release_tex_and_continue;
582 stru_506E40.Release(); 536 stru_506E40.Release();
583 continue; 537 continue;
584 case UIMSG_Game_OpenSaveGameDialog: 538 case UIMSG_Game_OpenSaveGameDialog:
585 pGUIWindow_CurrentMenu->Release(); 539 pGUIWindow_CurrentMenu->Release();
586 pCurrentScreen = SCREEN_SAVEGAME; 540 pCurrentScreen = SCREEN_SAVEGAME;
587 GameUI_DrawSaveMenu(); 541 GameUI_DrawSaveMenu();
588 continue; 542 continue;
589 case UIMSG_Game_OpenOptionsDialog: 543 case UIMSG_Game_OpenOptionsDialog://Open
590 if ( pMessageQueue_50CBD0->uNumMessages ) 544 if ( pMessageQueue_50CBD0->uNumMessages )
591 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 545 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
592 pGUIWindow_CurrentMenu->Release(); 546 pGUIWindow_CurrentMenu->Release();
593 viewparams->field_48 = v0; 547 viewparams->field_48 = v0;
594 pCurrentScreen = SCREEN_OPTIONS; 548 pCurrentScreen = SCREEN_OPTIONS;
595 uTextureID_ControlBG = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); 549 uTextureID_ControlBG[0] = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
596 uTextureID_Con_Smoo[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); 550 uTextureID_ControlBG[3] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
597 uTextureID_Con_Smoo[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); 551 uTextureID_ControlBG[2] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
598 uTextureID_Con_ArrL = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); 552 uTextureID_ControlBG[4] = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
599 uTextureID_Con_ArrR = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); 553 uTextureID_ControlBG[5] = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
600 uTextureID_Con_Smoo[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); 554 uTextureID_ControlBG[1] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
601 pTextureIDs_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); 555 uTextureID_ControlBG[19] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
602 pTextureIDs_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); 556 uTextureID_ControlBG[10] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
603 pTextureIDs_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); 557 uTextureID_ControlBG[11] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
604 pTextureIDs_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); 558 uTextureID_ControlBG[12] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
605 pTextureIDs_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); 559 uTextureID_ControlBG[13] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
606 pTextureIDs_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); 560 uTextureID_ControlBG[14] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
607 pTextureIDs_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); 561 uTextureID_ControlBG[15] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
608 pTextureIDs_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); 562 uTextureID_ControlBG[16] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
609 pTextureIDs_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); 563 uTextureID_ControlBG[17] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
610 pTextureIDs_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); 564 uTextureID_ControlBG[18] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
611 uTextureID_Option04 = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); 565 uTextureID_ControlBG[9] = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
612 uTextureID_Option03 = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); 566 uTextureID_ControlBG[20] = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
613 uTextureID_Option02 = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); 567 uTextureID_ControlBG[22] = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
614 uTextureID_Option01 = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); 568 uTextureID_ControlBG[21] = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
615 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); 569 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
616 pGUIWindow_CurrentMenu->CreateButton(0x16u, 0x10Eu, 570 pGUIWindow_CurrentMenu->CreateButton(0x16u, 0x10Eu,
617 (uTextureID_Con_Smoo[2] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[2]].uTextureWidth : 24), 571 (uTextureID_ControlBG[3] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[3]].uTextureWidth : 24),
618 (uTextureID_Con_Smoo[2] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[2]].uTextureHeight : 26), 572 (uTextureID_ControlBG[3] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[3]].uTextureHeight : 26),
619 v0, 0, 0xB8u, 0x80u, 0, v1, 0); 573 v0, 0, 0xB8u, 0x80u, 0, v1, 0);
620 pGUIWindow_CurrentMenu->CreateButton(0x5Du, 0x10Eu, 574 pGUIWindow_CurrentMenu->CreateButton(0x5Du, 0x10Eu,
621 (uTextureID_Con_Smoo[1] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[1]].uTextureWidth : 24), 575 (uTextureID_ControlBG[2] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[2]].uTextureWidth : 24),
622 (uTextureID_Con_Smoo[1] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[1]].uTextureHeight : 26), 576 (uTextureID_ControlBG[2] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[2]].uTextureHeight : 26),
623 v0, 0, 0xB8u, 0x40u, 0, v1, 0); 577 v0, 0, 0xB8u, 0x40u, 0, v1, 0);
624 pGUIWindow_CurrentMenu->CreateButton(0xA4u, 0x10Eu, 578 pGUIWindow_CurrentMenu->CreateButton(0xA4u, 0x10Eu,
625 (uTextureID_Con_Smoo[0] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[0]].uTextureWidth : 24), 579 (uTextureID_ControlBG[1] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[1]].uTextureWidth : 24),
626 (uTextureID_Con_Smoo[0] != -1 ? pIcons_LOD->pTextures[uTextureID_Con_Smoo[0]].uTextureHeight : 26), 580 (uTextureID_ControlBG[1] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[1]].uTextureHeight : 26),
627 v0, 0, 0xB8u, 0, 0, v1, 0); 581 v0, 0, 0xB8u, 0, 0, v1, 0);
628 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x12Fu, 582 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x12Fu,
629 (uTextureID_Option01 != -1 ? pIcons_LOD->pTextures[uTextureID_Option01].uTextureWidth : 24), 583 (uTextureID_ControlBG[21] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[21]].uTextureWidth : 24),
630 (uTextureID_Option01 != -1 ? pIcons_LOD->pTextures[uTextureID_Option01].uTextureHeight : 26), 584 (uTextureID_ControlBG[21] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[21]].uTextureHeight : 26),
631 v0, 0, 0xB9u, 0, 0, v1, 0); 585 v0, 0, 0xB9u, 0, 0, v1, 0);
632 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x12Fu, 586 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x12Fu,
633 (uTextureID_Option02 != -1 ? pIcons_LOD->pTextures[uTextureID_Option02].uTextureWidth : 24), 587 (uTextureID_ControlBG[22] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[22]].uTextureWidth : 24),
634 (uTextureID_Option02 != -1 ? pIcons_LOD->pTextures[uTextureID_Option02].uTextureHeight : 26), 588 (uTextureID_ControlBG[22] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[22]].uTextureHeight : 26),
635 v0, 0, 0xBBu, 0, 0, v1, 0); 589 v0, 0, 0xBBu, 0, 0, v1, 0);
636 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x145u, 590 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x145u,
637 (uTextureID_Option03 != -1 ? pIcons_LOD->pTextures[uTextureID_Option03].uTextureWidth : 24), 591 (uTextureID_ControlBG[20] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[20]].uTextureWidth : 24),
638 (uTextureID_Option03 != -1 ? pIcons_LOD->pTextures[uTextureID_Option03].uTextureHeight : 26), 592 (uTextureID_ControlBG[20] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[20]].uTextureHeight : 26),
639 v0, 0, 0xE1u, 0, 0, v1, 0); 593 v0, 0, 0xE1u, 0, 0, v1, 0);
640 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x145u, 594 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x145u,
641 (uTextureID_Option04 != -1 ? pIcons_LOD->pTextures[uTextureID_Option04].uTextureWidth : 24), 595 (uTextureID_ControlBG[9] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[9]].uTextureWidth : 24),
642 (uTextureID_Option04 != -1 ? pIcons_LOD->pTextures[uTextureID_Option04].uTextureHeight : 26), 596 (uTextureID_ControlBG[9] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[9]].uTextureHeight : 26),
643 v0, 0, 0xE2u, 0, 0, v1, 0); 597 v0, 0, 0xE2u, 0, 0, v1, 0);
644 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, 111, 4, 0, v1, 598 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, 111, 4, 0, v1,
645 &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0); 599 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0);
646 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xA2u, 0x10u, 0x10u, v0, 0, 0x6Fu, 5, 0, v1, 600 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xA2u, 0x10u, 0x10u, v0, 0, 0x6Fu, 5, 0, v1,
647 &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0); 601 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0);
648 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xA2u, 0xACu, 0x11u, v0, 0, 0x6Fu, 0, 0, v1, 0); 602 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xA2u, 0xACu, 0x11u, v0, 0, 0x6Fu, 0, 0, v1, 0);
649 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 4, 0, v1, 603 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 4, 0, v1,
650 &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0); 604 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0);
651 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 5, 0, v1, 605 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 5, 0, v1,
652 &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0); 606 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0);
653 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xD8u, 0xACu, 0x11u, v0, 0, 0x70u, 0, 0, v1, 0); 607 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xD8u, 0xACu, 0x11u, v0, 0, 0x70u, 0, 0, v1, 0);
654 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 4, 0, v1, 608 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 4, 0, v1,
655 &pIcons_LOD->pTextures[uTextureID_Con_ArrL], 0); 609 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0);
656 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 5u, 0, v1, 610 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 5u, 0, v1,
657 &pIcons_LOD->pTextures[uTextureID_Con_ArrR], 0); 611 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0);
658 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0x10Eu, 0xACu, 0x11u, v0, 0, 0xBAu, 0, 0, v1, 0); 612 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0x10Eu, 0xACu, 0x11u, v0, 0, 0xBAu, 0, 0, v1, 0);
659 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, 0x71u, 0, 0, 613 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, 0x71u, 0, 0,
660 pGlobalTXT_LocalizationStrings[619],// "Return to Game" 614 pGlobalTXT_LocalizationStrings[619],// "Return to Game"
661 0); 615 0);
662 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x8Cu, 0xD6u, 0x28u, v0, 0, 0x19Fu, 0, 0x4Bu, v1, 0); 616 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x8Cu, 0xD6u, 0x28u, v0, 0, 0x19Fu, 0, 0x4Bu, v1, 0);
663 pGUIWindow_CurrentMenu->CreateButton(19, 194, 214, 40, v0, 0, 421, 0, 86, v1, 0); 617 pGUIWindow_CurrentMenu->CreateButton(19, 194, 214, 40, v0, 0, 421, 0, 86, v1, 0);
664 continue; 618 continue;
665 case UIMSG_OpenKeyMappingOptions: 619 case UIMSG_OpenKeyMappingOptions://Open
666 if ( pMessageQueue_50CBD0->uNumMessages ) 620 if ( pMessageQueue_50CBD0->uNumMessages )
667 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 621 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
668 pGUIWindow_CurrentMenu->Release(); 622 pGUIWindow_CurrentMenu->Release();
669 viewparams->field_48 = 1; 623 viewparams->field_48 = 1;
670 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS; 624 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
671 uTextureID_Optkb = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); 625 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
672 uTextureID_Optkb_h = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); 626 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
673 uTextureID_KeyResume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); 627 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
674 uTextureID_Optkb_1 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); 628 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
675 uTextureID_Optkb_2 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); 629 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
676 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0); 630 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
677 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, "", 0); 631 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, "", 0);
678 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, "", 0); 632 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, "", 0);
679 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A1u, 0, 0, "", 0); 633 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A1u, 0, 0, "", 0);
680 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x1A2u, 0, 0, "", 0); 634 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x1A2u, 0, 0, "", 0);
693 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, 0x1A3u, 0xBu, 0, "", 0); 647 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, 0x1A3u, 0xBu, 0, "", 0);
694 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 0xCu, 0, "", 0); 648 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 0xCu, 0, "", 0);
695 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 0xDu, 0, "", 0); 649 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 0xDu, 0, "", 0);
696 dword_506E68 = -1; 650 dword_506E68 = -1;
697 KeyboardPageNum = 1; 651 KeyboardPageNum = 1;
698 memset(word_506E6C, 0, 0x1Cu); 652 memset(KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray));
699 word_506E6C[14] = 0; 653 //*(_WORD *)KeyButtonArray[28] = 0;
700 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); 654 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
701 //goto LABEL_90;
702 v1 = ""; 655 v1 = "";
703 v0 = 1; 656 v0 = 1;
704 continue; 657 continue;
705 //default:
706 //continue;
707 case UIMSG_ChangeKeyButton: 658 case UIMSG_ChangeKeyButton:
708 if ( dword_506E68 != -1 ) 659 if ( dword_506E68 != -1 )
709 { 660 {
710 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 661 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
711 continue; 662 continue;
739 } 690 }
740 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); 691 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
741 v18 = uAction++; 692 v18 = uAction++;
742 v13 = uAction > 28; 693 v13 = uAction > 28;
743 v12 = uAction - 28 < 0; 694 v12 = uAction - 28 < 0;
744 *((char *)word_506E6C + v18) = 0; 695 KeyButtonFlagChangesArray[v18] = 0;
745 } 696 }
746 while ( v12 ^ v13 ); 697 while ( v12 ^ v13 );
747 v165 = 0; 698 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
748 v151 = 0; 699 continue;
749 v144 = 0;
750 v139 = 0;
751 v135 = -1;
752 v132 = 0;
753 v130 = 0;
754 v127 = 219;
755 goto _play_sound_and_continue;
756 case UIMSG_SelectKeyPage1: 700 case UIMSG_SelectKeyPage1:
757 KeyboardPageNum = v0; 701 KeyboardPageNum = v0;
758 continue; 702 continue;
759 case UIMSG_SelectKeyPage2: 703 case UIMSG_SelectKeyPage2:
760 KeyboardPageNum = 2; 704 KeyboardPageNum = 2;
799 { 743 {
800 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 4u, 0, v1, 744 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 4u, 0, v1,
801 &pIcons_LOD->pTextures[uTextureID_507C20], 0); 745 &pIcons_LOD->pTextures[uTextureID_507C20], 0);
802 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 5u, 0, v1, 746 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 5u, 0, v1,
803 &pIcons_LOD->pTextures[uTextureID_507C24], 0); 747 &pIcons_LOD->pTextures[uTextureID_507C24], 0);
804 pTexture = 0; 748 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, 425, 0, 0, v1, 0);
805 v150 = v1;
806 v143 = 0;
807 v138 = 0;
808 v134 = 425;
809 v131 = 0;
810 v129 = 1;
811 v126 = 18;
812 v124 = 170;
813 v122 = 162;
814 v120 = 42;
815 //LABEL_117:
816 pGUIWindow_CurrentMenu->CreateButton(v120, v122, v124, v126, v129, v131, v134, v138, v143, v150, pTexture);
817 } 749 }
818 } 750 }
819 continue; 751 continue;
820 case UIMSG_1A9: 752 case UIMSG_1A9:
821 if ( uMessageParam == 4 ) 753 if ( uMessageParam == 4 )
822 { 754 {
823 //--uGammaPos; 755 //--uGammaPos;
824 if ( (uGammaPos -- -1) < 0 ) 756 if ( (uGammaPos -- -1) < 0 )
825 { 757 {
826 uGammaPos = 0; 758 uGammaPos = 0;
827 //goto LABEL_128; 759 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
828 v165 = 0; 760 continue;
829 v151 = 0;
830 v144 = 0;
831 v139 = 0;
832 v135 = -1;
833 v132 = 0;
834 v130 = 0;
835 v127 = 21;
836 goto _play_sound_and_continue;
837 } 761 }
838 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; 762 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
839 pGame->pGammaController->Initialize(v19); 763 pGame->pGammaController->Initialize(v19);
840 v166 = v0; 764 GUIWindow::Create(21, 161, 0, 0, (WindowType)90, (int)pBtn_SliderLeft, v0);
841 v152 = (int)pBtn_SliderLeft; 765 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
842 pWindowType2 = (WindowType)90; 766 continue;
843 v140 = 0;
844 v136 = 0;
845 v20 = 21;
846 //goto LABEL_122;
847 GUIWindow::Create(v20, 0xA1u, v136, v140, pWindowType2, v152, v166);
848 //goto LABEL_128;
849 v165 = 0;
850 v151 = 0;
851 v144 = 0;
852 v139 = 0;
853 v135 = -1;
854 v132 = 0;
855 v130 = 0;
856 v127 = 21;
857 goto _play_sound_and_continue;
858 } 767 }
859 if ( uMessageParam == 5 ) 768 if ( uMessageParam == 5 )
860 { 769 {
861 ++uGammaPos; 770 ++uGammaPos;
862 if ( (signed int)uGammaPos <= 9 ) 771 if ( (signed int)uGammaPos <= 9 )
863 { 772 {
864 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; 773 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
865 pGame->pGammaController->Initialize(v21); 774 pGame->pGammaController->Initialize(v21);
866 v20 = 213; 775 GUIWindow::Create(213, 161, 0, 0, (WindowType)90, (int)pBtn_SliderRight, v0);
867 v166 = v0; 776 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
868 v152 = (int)pBtn_SliderRight; 777 continue;
869 pWindowType2 = (WindowType)90;
870 v140 = 0;
871 v136 = 0;
872 //LABEL_122:
873 GUIWindow::Create(v20, 0xA1u, v136, v140, pWindowType2, v152, v166);
874 //goto LABEL_128;
875 v165 = 0;
876 v151 = 0;
877 v144 = 0;
878 v139 = 0;
879 v135 = -1;
880 v132 = 0;
881 v130 = 0;
882 v127 = 21;
883 goto _play_sound_and_continue;
884 } 778 }
885 uGammaPos = 9; 779 uGammaPos = 9;
886 } 780 }
887 else 781 else
888 { 782 {
889 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17; 783 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
890 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6; 784 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
891 pGame->pGammaController->Initialize(v22); 785 pGame->pGammaController->Initialize(v22);
892 } 786 }
893 //LABEL_128: 787 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
894 v165 = 0; 788 continue;
895 v151 = 0;
896 v144 = 0;
897 v139 = 0;
898 v135 = -1;
899 v132 = 0;
900 v130 = 0;
901 v127 = 21;
902 goto _play_sound_and_continue;
903 case UIMSG_ToggleBloodsplats: 789 case UIMSG_ToggleBloodsplats:
904 pGame->ToggleFlags2(0x20u); 790 pGame->ToggleFlags2(0x20u);
905 continue; 791 continue;
906 case UIMSG_ToggleColoredLights: 792 case UIMSG_ToggleColoredLights:
907 pRenderer->bUseColoredLights = pRenderer->bUseColoredLights == 0; 793 pRenderer->bUseColoredLights = pRenderer->bUseColoredLights == 0;
913 if ( uMessageParam == 4 ) 799 if ( uMessageParam == 4 )
914 { 800 {
915 --uMusicVolimeMultiplier; 801 --uMusicVolimeMultiplier;
916 if ( (char)uMusicVolimeMultiplier < 1 ) 802 if ( (char)uMusicVolimeMultiplier < 1 )
917 uMusicVolimeMultiplier = 0; 803 uMusicVolimeMultiplier = 0;
918 v167 = v0; 804 GUIWindow::Create(243, 0xD8u, 0, 0, (enum WindowType)90, (int)pBtn_SliderLeft, v0);
919 v23 = 243;
920 v153 = (int)pBtn_SliderLeft;
921 //LABEL_136:
922 GUIWindow::Create(v23, 0xD8u, 0, 0, (enum WindowType)90, v153, v167);
923 //goto LABEL_143;
924 if ( uMusicVolimeMultiplier ) 805 if ( uMusicVolimeMultiplier )
925 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); 806 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
926 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); 807 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
927 continue; 808 continue;
928 } 809 }
929 if ( uMessageParam == 5 ) 810 if ( uMessageParam == 5 )
930 { 811 {
931 ++uMusicVolimeMultiplier; 812 ++uMusicVolimeMultiplier;
932 if ( (char)uMusicVolimeMultiplier > 9 ) 813 if ( (char)uMusicVolimeMultiplier > 9 )
933 uMusicVolimeMultiplier = 9; 814 uMusicVolimeMultiplier = 9;
934 v167 = v0; 815 GUIWindow::Create(435, 0xD8u, 0, 0, (enum WindowType)90, (int)pBtn_SliderRight, v0);
935 v23 = 435;
936 v153 = (int)pBtn_SliderRight;
937 //goto LABEL_136;
938 GUIWindow::Create(v23, 0xD8u, 0, 0, (enum WindowType)90, v153, v167);
939 //goto LABEL_143;
940 if ( uMusicVolimeMultiplier ) 816 if ( uMusicVolimeMultiplier )
941 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); 817 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
942 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); 818 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
943 continue; 819 continue;
944 } 820 }
945 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17; 821 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;
946 if ( (char)uMusicVolimeMultiplier > 9 ) 822 if ( (char)uMusicVolimeMultiplier > 9 )
947 uMusicVolimeMultiplier = 9; 823 uMusicVolimeMultiplier = 9;
948 //LABEL_143:
949 if ( uMusicVolimeMultiplier ) 824 if ( uMusicVolimeMultiplier )
950 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); 825 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
951 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); 826 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
952 continue; 827 continue;
953 case UIMSG_ChangeSoundVolume: 828 case UIMSG_ChangeSoundVolume:
954 if ( uMessageParam == 4 )//reduce sound level 829 if ( uMessageParam == 4 )//reduce sound level button left
955 { 830 {
956 --uSoundVolumeMultiplier; 831 --uSoundVolumeMultiplier;
957 if ( (char)uSoundVolumeMultiplier < 1 ) 832 if ( (char)uSoundVolumeMultiplier < 1 )
958 uSoundVolumeMultiplier = 0; 833 uSoundVolumeMultiplier = 0;
959 GUIWindow::Create(243, 162, 0, 0, (enum WindowType)90, (int)pBtn_SliderLeft, v0); 834 GUIWindow::Create(243, 162, 0, 0, (enum WindowType)90, (int)pBtn_SliderLeft, v0);
960 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 835 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
961 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); 836 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
962 continue; 837 continue;
963 } 838 }
964 if ( uMessageParam == 5 )//Increase sound level 839 if ( uMessageParam == 5 )//Increase sound level button right
965 { 840 {
966 ++uSoundVolumeMultiplier; 841 ++uSoundVolumeMultiplier;
967 if ( (char)uSoundVolumeMultiplier > 8 ) 842 if ( (char)uSoundVolumeMultiplier > 8 )
968 uSoundVolumeMultiplier = 9; 843 uSoundVolumeMultiplier = 9;
969 v168 = v0; 844 v168 = v0;
970 v24 = 435; 845 v24 = 435;
971 v154 = (int)pBtn_SliderRight; 846 v154 = (int)pBtn_SliderRight;
972 //goto LABEL_150;
973 GUIWindow::Create(v24, 0xA2u, 0, 0, (enum WindowType)90, v154, v168); 847 GUIWindow::Create(v24, 0xA2u, 0, 0, (enum WindowType)90, v154, v168);
974 //goto LABEL_157;
975 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 848 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
976 v165 = 0; 849 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
977 v151 = 0; 850 continue;
978 v144 = 0;
979 v139 = 0;
980 v135 = -1;
981 v132 = 0;
982 v130 = -1;
983 v127 = 218;
984 goto _play_sound_and_continue;
985 } 851 }
986 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; 852 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
987 if ( (char)uSoundVolumeMultiplier > 8 ) 853 if ( (char)uSoundVolumeMultiplier > 8 )
988 uSoundVolumeMultiplier = 9; 854 uSoundVolumeMultiplier = 9;
989 //LABEL_157:
990 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 855 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
991 v165 = 0; 856 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
992 v151 = 0; 857 continue;
993 v144 = 0;
994 v139 = 0;
995 v135 = -1;
996 v132 = 0;
997 v130 = -1;
998 v127 = 218;
999 goto _play_sound_and_continue;
1000 case UIMSG_ToggleFlipOnExit: 858 case UIMSG_ToggleFlipOnExit:
1001 bFlipOnExit = bFlipOnExit == 0; 859 bFlipOnExit = bFlipOnExit == 0;
1002 continue; 860 continue;
1003 case UIMSG_ToggleAlwaysRun: 861 case UIMSG_ToggleAlwaysRun:
1004 bAlwaysRun = bAlwaysRun == 0; 862 bAlwaysRun = bAlwaysRun == 0;
1013 if ( uMessageParam == 4 ) 871 if ( uMessageParam == 4 )
1014 { 872 {
1015 --uVoicesVolumeMultiplier; 873 --uVoicesVolumeMultiplier;
1016 if ( (char)uVoicesVolumeMultiplier < 1 ) 874 if ( (char)uVoicesVolumeMultiplier < 1 )
1017 uVoicesVolumeMultiplier = 0; 875 uVoicesVolumeMultiplier = 0;
1018 v169 = v0; 876 GUIWindow::Create(243, 270, 0, 0, (enum WindowType)90, (int)pBtn_SliderLeft, v0);
1019 v25 = 243;
1020 v155 = (int)pBtn_SliderLeft;
1021 //LABEL_166:
1022 GUIWindow::Create(v25, 0x10Eu, 0, 0, (enum WindowType)90, v155, v169);
1023 //goto LABEL_173;
1024 if ( !uVoicesVolumeMultiplier ) 877 if ( !uVoicesVolumeMultiplier )
1025 continue; 878 continue;
1026 v165 = 0; 879 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
1027 v151 = pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f; 880 continue;
1028 v144 = 0;
1029 v139 = 0;
1030 v135 = -1;
1031 v132 = 0;
1032 v130 = -1;
1033 v127 = 5788;
1034 goto _play_sound_and_continue;
1035 } 881 }
1036 if ( uMessageParam == 5 ) 882 if ( uMessageParam == 5 )
1037 { 883 {
1038 ++uVoicesVolumeMultiplier; 884 ++uVoicesVolumeMultiplier;
1039 if ( (char)uVoicesVolumeMultiplier > 8 ) 885 if ( (char)uVoicesVolumeMultiplier > 8 )
1040 uVoicesVolumeMultiplier = 9; 886 uVoicesVolumeMultiplier = 9;
1041 v169 = v0; 887 GUIWindow::Create(435, 270, 0, 0, (enum WindowType)90, (int)pBtn_SliderRight, v0);
1042 v25 = 435;
1043 v155 = (int)pBtn_SliderRight;
1044 //goto LABEL_166;
1045 GUIWindow::Create(v25, 0x10Eu, 0, 0, (enum WindowType)90, v155, v169);
1046 //goto LABEL_173;
1047 if ( !uVoicesVolumeMultiplier ) 888 if ( !uVoicesVolumeMultiplier )
1048 continue; 889 continue;
1049 v165 = 0; 890 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
1050 v151 = pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f; 891 continue;
1051 v144 = 0;
1052 v139 = 0;
1053 v135 = -1;
1054 v132 = 0;
1055 v130 = -1;
1056 v127 = 5788;
1057 goto _play_sound_and_continue;
1058 } 892 }
1059 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17; 893 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
1060 if ( (char)uVoicesVolumeMultiplier > 8 ) 894 if ( (char)uVoicesVolumeMultiplier > 8 )
1061 uVoicesVolumeMultiplier = 9; 895 uVoicesVolumeMultiplier = 9;
1062 //LABEL_173:
1063 if ( !uVoicesVolumeMultiplier ) 896 if ( !uVoicesVolumeMultiplier )
1064 continue; 897 continue;
1065 v165 = 0; 898 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
1066 v151 = pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f; 899 continue;
1067 v144 = 0;
1068 v139 = 0;
1069 v135 = -1;
1070 v132 = 0;
1071 v130 = -1;
1072 v127 = 5788;
1073 goto _play_sound_and_continue;
1074 case UIMSG_SetTurnSpeed: 900 case UIMSG_SetTurnSpeed:
1075 if ( uMessageParam ) 901 if ( uMessageParam )
1076 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam; 902 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
1077 uTurnSpeed = uMessageParam; 903 uTurnSpeed = uMessageParam;
1078 continue; 904 continue;
1079 case UIMSG_SetGraphicsMode: 905 case UIMSG_SetGraphicsMode:
1080 if ( !bUseLoResSprites ) 906 if ( !bUseLoResSprites )
1081 { 907 {
1082 byte_6BE388_graphicsmode = uMessageParam; 908 byte_6BE388_graphicsmode = uMessageParam;
1083 //LABEL_184:
1084 MM7Initialization(); 909 MM7Initialization();
1085 continue; 910 continue;
1086 } 911 }
1087 if ( uMessageParam ) 912 if ( uMessageParam )
1088 { 913 {
1094 { 919 {
1095 if ( uMessageParam != 2 ) 920 if ( uMessageParam != 2 )
1096 continue; 921 continue;
1097 byte_6BE388_graphicsmode = 1; 922 byte_6BE388_graphicsmode = 1;
1098 } 923 }
1099 //goto LABEL_184;
1100 MM7Initialization(); 924 MM7Initialization();
1101 continue; 925 continue;
1102 } 926 }
1103 ModalWindow(pNPCTopics[453].pText, 0); 927 ModalWindow(pNPCTopics[453].pText, 0);
1104 continue; 928 continue;
1105 case UIMSG_7B: 929 case UIMSG_GameMenu_ReturnToGame:
1106 pGUIWindow_CurrentMenu->Release(); 930 pGUIWindow_CurrentMenu->Release();
1107 pEventTimer->Resume(); 931 pEventTimer->Resume();
1108 goto LABEL_188; 932 pCurrentScreen = SCREEN_GAME;
933 viewparams->bRedrawGameUI = v0;
934 stru_506E40.Release();
935 continue;
1109 case UIMSG_OpenQuestBook: 936 case UIMSG_OpenQuestBook:
1110 if ( pMessageQueue_50CBD0->uNumMessages ) 937 if ( pMessageQueue_50CBD0->uNumMessages )
1111 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 938 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1112 if ( pCurrentScreen ) 939 if ( pCurrentScreen )
1113 pGUIWindow_CurrentMenu->Release(); 940 pGUIWindow_CurrentMenu->Release();
1135 pGUIWindow_CurrentMenu->Release(); 962 pGUIWindow_CurrentMenu->Release();
1136 pEventTimer->Pause(); 963 pEventTimer->Pause();
1137 viewparams->sPartyPosX = pParty->vPosition.x; 964 viewparams->sPartyPosX = pParty->vPosition.x;
1138 viewparams->sPartyPosZ = pParty->vPosition.y; 965 viewparams->sPartyPosZ = pParty->vPosition.y;
1139 pAudioPlayer->StopChannels(-1, -1); 966 pAudioPlayer->StopChannels(-1, -1);
1140 pWindow = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); 967 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0);
1141 v27 = 353; 968 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, (enum WindowType)99, (int)pBtn_Maps, 0);
1142 v28 = 546;
1143 v170 = 0;
1144 v156 = (int)pBtn_Maps;
1145 //goto LABEL_210;
1146 pGUIWindow_CurrentMenu = pWindow;
1147 pBooksWindow = GUIWindow::Create(v28, v27, 0, 0, (enum WindowType)99, v156, v170);
1148 continue; 969 continue;
1149 case UIMSG_OpenCalendar: 970 case UIMSG_OpenCalendar:
1150 if ( pMessageQueue_50CBD0->uNumMessages ) 971 if ( pMessageQueue_50CBD0->uNumMessages )
1151 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 972 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1152 if ( pCurrentScreen ) 973 if ( pCurrentScreen )
1153 pGUIWindow_CurrentMenu->Release(); 974 pGUIWindow_CurrentMenu->Release();
1154 pEventTimer->Pause(); 975 pEventTimer->Pause();
1155 pAudioPlayer->StopChannels(-1, -1); 976 pAudioPlayer->StopChannels(-1, -1);
1156 pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); 977 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
1157 v27 = 354; 978 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, (enum WindowType)99, (int)pBtn_Calendar, 0);
1158 v28 = 570;
1159 v170 = 0;
1160 v156 = (int)pBtn_Calendar;
1161 //LABEL_210:
1162 pGUIWindow_CurrentMenu = pWindow;
1163 pBooksWindow = GUIWindow::Create(v28, v27, 0, 0, (enum WindowType)99, v156, v170);
1164 continue; 979 continue;
1165 case UIMSG_OpenHistoryBook: 980 case UIMSG_OpenHistoryBook:
1166 if ( pMessageQueue_50CBD0->uNumMessages ) 981 if ( pMessageQueue_50CBD0->uNumMessages )
1167 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 982 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1168 if ( pCurrentScreen ) 983 if ( pCurrentScreen )
1171 pAudioPlayer->StopChannels(-1, -1); 986 pAudioPlayer->StopChannels(-1, -1);
1172 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); 987 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
1173 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, (enum WindowType)99, (int)pBtn_History, 0); 988 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, (enum WindowType)99, (int)pBtn_History, 0);
1174 bFlashHistoryBook = 0; 989 bFlashHistoryBook = 0;
1175 continue; 990 continue;
1176 case UIMSG_Escape:// íàæàòèå Escape 991 case UIMSG_Escape:// íàæàòèå Escape and return to game
1177 back_to_game(); 992 back_to_game();
1178 if ( pMessageQueue_50CBD0->uNumMessages ) 993 if ( pMessageQueue_50CBD0->uNumMessages )
1179 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 994 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1180 if ( pCurrentScreen > SCREEN_F ) 995 if ( pCurrentScreen > SCREEN_F )
1181 { 996 {
1182 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) ) 997 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) )
1183 { 998 {
1184 //LABEL_229:
1185 if ( dword_50CDC8 ) 999 if ( dword_50CDC8 )
1186 goto LABEL_232; 1000 goto LABEL_232;
1187 CloseWindowBackground(); 1001 CloseWindowBackground();
1188 //goto LABEL_231;
1189 uMessageParam = v0; 1002 uMessageParam = v0;
1190 goto LABEL_232; 1003 goto LABEL_232;
1191 } 1004 }
1192 } 1005 }
1193 else 1006 else
1194 { 1007 {
1195 if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST ) 1008 if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST )
1196 { 1009 {
1197 //goto LABEL_229;
1198 if ( dword_50CDC8 ) 1010 if ( dword_50CDC8 )
1199 goto LABEL_232; 1011 goto LABEL_232;
1200 CloseWindowBackground(); 1012 CloseWindowBackground();
1201 //goto LABEL_231;
1202 uMessageParam = v0; 1013 uMessageParam = v0;
1203 goto LABEL_232; 1014 goto LABEL_232;
1204 } 1015 }
1205 if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 ) 1016 if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 )
1206 { 1017 {
1207 CloseWindowBackground(); 1018 CloseWindowBackground();
1208 dword_5C35C8 = 0; 1019 dword_5C35C8 = 0;
1209 //LABEL_231:
1210 uMessageParam = v0; 1020 uMessageParam = v0;
1211 goto LABEL_232;
1212 } 1021 }
1213 } 1022 }
1214 LABEL_232: 1023 LABEL_232:
1215 if ( !ptr_507BDC ) 1024 if ( !ptr_507BDC )
1216 { 1025 {
1247 { 1056 {
1248 LOBYTE(ptr_50C9A4->uAttributes) &= 0xFu; 1057 LOBYTE(ptr_50C9A4->uAttributes) &= 0xFu;
1249 dword_50C9A8 = 0; 1058 dword_50C9A8 = 0;
1250 ptr_50C9A4 = 0; 1059 ptr_50C9A4 = 0;
1251 } 1060 }
1252 //goto LABEL_322;
1253 if ( pGUIWindow_Settings ) 1061 if ( pGUIWindow_Settings )
1254 { 1062 {
1255 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1063 if ( pCurrentScreen == SCREEN_CHARACTERS )
1256 { 1064 {
1257 pMouse->SetCursorBitmap("MICON2"); 1065 pMouse->SetCursorBitmap("MICON2");
1280 case SCREEN_BOOKS: 1088 case SCREEN_BOOKS:
1281 pBooksWindow->Release(); 1089 pBooksWindow->Release();
1282 //crt_deconstruct_ptr_6A0118(); 1090 //crt_deconstruct_ptr_6A0118();
1283 pBooksWindow = 0; 1091 pBooksWindow = 0;
1284 pEventTimer->Resume(); 1092 pEventTimer->Resume();
1285 //goto LABEL_322;
1286 if ( pGUIWindow_Settings ) 1093 if ( pGUIWindow_Settings )
1287 { 1094 {
1288 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1095 if ( pCurrentScreen == SCREEN_CHARACTERS )
1289 { 1096 {
1290 pMouse->SetCursorBitmap("MICON2"); 1097 pMouse->SetCursorBitmap("MICON2");
1312 continue; 1119 continue;
1313 case SCREEN_SAVEGAME: 1120 case SCREEN_SAVEGAME:
1314 case SCREEN_LOADGAME: 1121 case SCREEN_LOADGAME:
1315 pIcons_LOD->_4114F2(); 1122 pIcons_LOD->_4114F2();
1316 //crt_deconstruct_ptr_6A0118(); 1123 //crt_deconstruct_ptr_6A0118();
1317 //goto LABEL_291;
1318 stru_506E40.Release(); 1124 stru_506E40.Release();
1319 break; 1125 break;
1320 case SCREEN_F: 1126 case SCREEN_F:
1321 pCurrentScreen = SCREEN_CHEST; 1127 pCurrentScreen = SCREEN_CHEST;
1322 continue; 1128 continue;
1323 case SCREEN_CHEST: 1129 case SCREEN_CHEST:
1324 pWindow2 = pChestWindow; 1130 pWindow2 = pChestWindow;
1325 //goto LABEL_249;
1326 pWindow2->Release(); 1131 pWindow2->Release();
1327 pIcons_LOD->_4114F2(); 1132 pIcons_LOD->_4114F2();
1328 pCurrentScreen = SCREEN_GAME; 1133 pCurrentScreen = SCREEN_GAME;
1329 viewparams->bRedrawGameUI = v0; 1134 viewparams->bRedrawGameUI = v0;
1330 pEventTimer->Resume(); 1135 pEventTimer->Resume();
1331 continue; 1136 continue;
1332 case SCREEN_19: 1137 case SCREEN_19:
1333 pWindow2 = ptr_507BC8; 1138 pWindow2 = ptr_507BC8;
1334 //LABEL_249:
1335 pWindow2->Release(); 1139 pWindow2->Release();
1336 pIcons_LOD->_4114F2(); 1140 pIcons_LOD->_4114F2();
1337 pCurrentScreen = SCREEN_GAME; 1141 pCurrentScreen = SCREEN_GAME;
1338 viewparams->bRedrawGameUI = v0; 1142 viewparams->bRedrawGameUI = v0;
1339 pEventTimer->Resume(); 1143 pEventTimer->Resume();
1340 continue; 1144 continue;
1341 case SCREEN_OPTIONS: 1145 case SCREEN_OPTIONS://Close
1342 thisa = (signed int)&uTextureID_ControlBG; 1146 thisa = (signed int)&uTextureID_ControlBG;
1343 do 1147 do
1344 { 1148 {
1345 if ( *(int *)thisa ) 1149 if ( *(int *)thisa )
1346 pIcons_LOD->pTextures[*(int *)thisa].Release(); 1150 pIcons_LOD->pTextures[*(int *)thisa].Release();
1358 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); 1162 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
1359 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); 1163 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
1360 if ( !uTurnSpeed ) 1164 if ( !uTurnSpeed )
1361 { 1165 {
1362 v171 = 3; 1166 v171 = 3;
1363 //goto LABEL_261;
1364 v30 = v171; 1167 v30 = v171;
1365 //goto LABEL_262;
1366 v31 = "TurnDelta"; 1168 v31 = "TurnDelta";
1367 WriteWindowsRegistryInt(v31, v30); 1169 WriteWindowsRegistryInt(v31, v30);
1368 stru_506E40.Release(); 1170 stru_506E40.Release();
1369 break; 1171 break;
1370 } 1172 }
1371 if ( uTurnSpeed == 64 ) 1173 if ( uTurnSpeed == 64 )
1372 { 1174 {
1373 v171 = 2; 1175 v171 = 2;
1374 //LABEL_261:
1375 v30 = v171; 1176 v30 = v171;
1376 //goto LABEL_262;
1377 v31 = "TurnDelta"; 1177 v31 = "TurnDelta";
1378 WriteWindowsRegistryInt(v31, v30); 1178 WriteWindowsRegistryInt(v31, v30);
1379 stru_506E40.Release(); 1179 stru_506E40.Release();
1380 break; 1180 break;
1381 } 1181 }
1382 if ( uTurnSpeed != 128 ) 1182 if ( uTurnSpeed != 128 )
1383 //goto LABEL_291;
1384 { 1183 {
1385 stru_506E40.Release(); 1184 stru_506E40.Release();
1386 break; 1185 break;
1387 } 1186 }
1388 v30 = v0; 1187 v30 = v0;
1389 //LABEL_262:
1390 v31 = "TurnDelta"; 1188 v31 = "TurnDelta";
1391 //LABEL_263:
1392 WriteWindowsRegistryInt(v31, v30); 1189 WriteWindowsRegistryInt(v31, v30);
1393 //LABEL_291:
1394 stru_506E40.Release(); 1190 stru_506E40.Release();
1395 break; 1191 break;
1396 case SCREEN_MENU: 1192 case SCREEN_MENU:
1397 pIcons_LOD->_40F9C5(); 1193 pIcons_LOD->_40F9C5();
1398 pIcons_LOD->_4114F2(); 1194 pIcons_LOD->_4114F2();
1399 pIcons_LOD->_40F9C5(); 1195 pIcons_LOD->_40F9C5();
1400 pIcons_LOD->_4114F2(); 1196 pIcons_LOD->_4114F2();
1401 //goto LABEL_291;
1402 stru_506E40.Release(); 1197 stru_506E40.Release();
1403 break; 1198 break;
1404 case SCREEN_VIDEO_OPTIONS: 1199 case SCREEN_VIDEO_OPTIONS:
1405 if ( pRenderer->pRenderD3D ) 1200 if ( pRenderer->pRenderD3D )
1406 { 1201 {
1407 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights); 1202 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
1408 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting); 1203 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
1409 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1); 1204 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1);
1410 } 1205 }
1411 if ( pRenderer->bWindowMode ) 1206 if ( pRenderer->bWindowMode )
1412 //goto LABEL_291;
1413 { 1207 {
1414 stru_506E40.Release(); 1208 stru_506E40.Release();
1415 break; 1209 break;
1416 } 1210 }
1417 v30 = uGammaPos; 1211 v30 = uGammaPos;
1418 v31 = "GammaPos"; 1212 v31 = "GammaPos";
1419 //goto LABEL_263;
1420 WriteWindowsRegistryInt(v31, v30); 1213 WriteWindowsRegistryInt(v31, v30);
1421 stru_506E40.Release(); 1214 stru_506E40.Release();
1422 break; 1215 break;
1423 case SCREEN_KEYBOARD_OPTIONS: 1216 case SCREEN_KEYBOARD_OPTIONS://Return to game
1424 v197 = 1; 1217 v197 = 1;
1425 v32 = 0; 1218 v32 = 0;
1426 while ( *((char *)word_506E6C + v32) != 1 ) 1219 while ( KeyButtonFlagChangesArray[v32] != 1 )
1427 { 1220 {
1428 ++v32; 1221 ++v32;
1429 if ( v32 >= 28 ) 1222 if ( v32 >= 28 )
1430 { 1223 {
1431 thisb = (signed int)&uTextureID_Optkb; 1224 thisb = (signed int)&uTextureID_Optkb;
1463 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType); 1256 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType);
1464 ++uAction; 1257 ++uAction;
1465 } 1258 }
1466 while ( uAction < 28 ); 1259 while ( uAction < 28 );
1467 pKeyActionMap->StoreMappings(); 1260 pKeyActionMap->StoreMappings();
1468 //goto LABEL_291;
1469 stru_506E40.Release(); 1261 stru_506E40.Release();
1470 break; 1262 break;
1471 } 1263 }
1472 } 1264 }
1473 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 1265 break;
1474 continue;
1475 case SCREEN_REST: 1266 case SCREEN_REST:
1476 if ( dword_506F14 ) 1267 if ( dword_506F14 )
1477 { 1268 {
1478 Rest(_506F18_num_hours_to_sleep); 1269 Rest(_506F18_num_hours_to_sleep);
1479 pParty->pPlayers[3].pConditions[2] = 0i64; 1270 pParty->pPlayers[3].pConditions[2] = 0i64;
1488 pIcons_LOD->_40F9C5(); 1279 pIcons_LOD->_40F9C5();
1489 pIcons_LOD->_4114F2(); 1280 pIcons_LOD->_4114F2();
1490 _506F18_num_hours_to_sleep = 0; 1281 _506F18_num_hours_to_sleep = 0;
1491 dword_506F14 = 0; 1282 dword_506F14 = 0;
1492 dword_507B94 = v0; 1283 dword_507B94 = v0;
1493 //goto LABEL_322;
1494 if ( pGUIWindow_Settings ) 1284 if ( pGUIWindow_Settings )
1495 { 1285 {
1496 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1286 if ( pCurrentScreen == SCREEN_CHARACTERS )
1497 { 1287 {
1498 pMouse->SetCursorBitmap("MICON2"); 1288 pMouse->SetCursorBitmap("MICON2");
1538 } 1328 }
1539 sub_4B1D27(); 1329 sub_4B1D27();
1540 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0); 1330 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0);
1541 pVideoPlayer->Unload(); 1331 pVideoPlayer->Unload();
1542 pGUIWindow_CurrentMenu = window_SpeakInHouse; 1332 pGUIWindow_CurrentMenu = window_SpeakInHouse;
1543 //goto LABEL_322;
1544 if ( pGUIWindow_Settings ) 1333 if ( pGUIWindow_Settings )
1545 { 1334 {
1546 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1335 if ( pCurrentScreen == SCREEN_CHARACTERS )
1547 { 1336 {
1548 pMouse->SetCursorBitmap("MICON2"); 1337 pMouse->SetCursorBitmap("MICON2");
1570 continue; 1359 continue;
1571 case SCREEN_INPUT_BLV: 1360 case SCREEN_INPUT_BLV:
1572 if ( uCurrentHouse_Animation == 153 ) 1361 if ( uCurrentHouse_Animation == 153 )
1573 HousePlaySomeSound(0x99u, 3); 1362 HousePlaySomeSound(0x99u, 3);
1574 pVideoPlayer->Unload(); 1363 pVideoPlayer->Unload();
1575 //goto LABEL_306;
1576 if ( dword_5B65CC ) 1364 if ( dword_5B65CC )
1577 { 1365 {
1578 pParty->field_709 = 0; 1366 pParty->field_709 = 0;
1579 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; 1367 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
1580 sub_44A56A(); 1368 sub_44A56A();
1581 viewparams->bRedrawGameUI = v0; 1369 viewparams->bRedrawGameUI = v0;
1582 dword_5B65CC = 0; 1370 dword_5B65CC = 0;
1583 } 1371 }
1584 goto LABEL_317; 1372 goto LABEL_317;
1585 case SCREEN_NPC_DIALOGUE: 1373 case SCREEN_NPC_DIALOGUE:
1586 //LABEL_306:
1587 if ( dword_5B65CC ) 1374 if ( dword_5B65CC )
1588 { 1375 {
1589 pParty->field_709 = 0; 1376 pParty->field_709 = 0;
1590 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; 1377 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
1591 sub_44A56A(); 1378 sub_44A56A();
1611 pVideoPlayer->Unload(); 1398 pVideoPlayer->Unload();
1612 continue; 1399 continue;
1613 case SCREEN_CHARACTERS: 1400 case SCREEN_CHARACTERS:
1614 goto LABEL_319; 1401 goto LABEL_319;
1615 default: 1402 default:
1616 //goto LABEL_322;
1617 if ( pGUIWindow_Settings ) 1403 if ( pGUIWindow_Settings )
1618 { 1404 {
1619 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1405 if ( pCurrentScreen == SCREEN_CHARACTERS )
1620 { 1406 {
1621 pMouse->SetCursorBitmap("MICON2"); 1407 pMouse->SetCursorBitmap("MICON2");
1640 pCurrentScreen = SCREEN_GAME; 1426 pCurrentScreen = SCREEN_GAME;
1641 viewparams->bRedrawGameUI = v0; 1427 viewparams->bRedrawGameUI = v0;
1642 pIcons_LOD->_4355F7(); 1428 pIcons_LOD->_4355F7();
1643 continue; 1429 continue;
1644 } 1430 }
1645 //goto LABEL_322;
1646 if ( pGUIWindow_Settings ) 1431 if ( pGUIWindow_Settings )
1647 { 1432 {
1648 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1433 if ( pCurrentScreen == SCREEN_CHARACTERS )
1649 { 1434 {
1650 pMouse->SetCursorBitmap("MICON2"); 1435 pMouse->SetCursorBitmap("MICON2");
1675 sub_4196A0(); 1460 sub_4196A0();
1676 sub_419379(); 1461 sub_419379();
1677 LABEL_321: 1462 LABEL_321:
1678 pIcons_LOD->_4114F2(); 1463 pIcons_LOD->_4114F2();
1679 } 1464 }
1680 //LABEL_322:
1681 if ( pGUIWindow_Settings ) 1465 if ( pGUIWindow_Settings )
1682 { 1466 {
1683 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1467 if ( pCurrentScreen == SCREEN_CHARACTERS )
1684 { 1468 {
1685 pMouse->SetCursorBitmap("MICON2"); 1469 pMouse->SetCursorBitmap("MICON2");
1750 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 1534 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
1751 free((void *)uNumSeconds); 1535 free((void *)uNumSeconds);
1752 stru_506E40._40E55E("gamma.pcx", 0); 1536 stru_506E40._40E55E("gamma.pcx", 0);
1753 continue; 1537 continue;
1754 } 1538 }
1755 //goto LABEL_333;
1756 pWindow3->Release(); 1539 pWindow3->Release();
1757 pGUIWindow_Settings = 0; 1540 pGUIWindow_Settings = 0;
1758 pMouse->SetCursorBitmap("MICON1"); 1541 pMouse->SetCursorBitmap("MICON1");
1759 GameUI_StatusBar_TimedStringTimeLeft = 0; 1542 GameUI_StatusBar_TimedStringTimeLeft = 0;
1760 unk_50C9A0 = 0; 1543 unk_50C9A0 = 0;
14798 v3 = pGUIWindow_CurrentMenu; 14581 v3 = pGUIWindow_CurrentMenu;
14799 dword_507C08 = v2; 14582 dword_507C08 = v2;
14800 if ( pGUIWindow_CurrentMenu->field_40 == 2 ) 14583 if ( pGUIWindow_CurrentMenu->field_40 == 2 )
14801 { 14584 {
14802 pPrevVirtualCidesMapping[dword_506E68] = pKeyActionMap->pPressedKeysBuffer[0]; 14585 pPrevVirtualCidesMapping[dword_506E68] = pKeyActionMap->pPressedKeysBuffer[0];
14803 memset(word_506E6C, 0, 0x1Cu); 14586 memset(&KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray));
14804 v4 = 0; 14587 v4 = 0;
14805 do 14588 do
14806 { 14589 {
14807 v5 = 0; 14590 v5 = 0;
14808 do 14591 do
14809 { 14592 {
14810 if ( v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5] ) 14593 if ( v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5] )
14811 { 14594 {
14812 *((char *)word_506E6C + v4) = 1; 14595 KeyButtonFlagChangesArray[v4] = 1;
14813 *((char *)word_506E6C + v5) = 1; 14596 KeyButtonFlagChangesArray[v5] = 1;
14814 } 14597 }
14815 ++v5; 14598 ++v5;
14816 } 14599 }
14817 while ( v5 < 28 ); 14600 while ( v5 < 28 );
14818 ++v4; 14601 ++v4;
14819 } 14602 }
14820 while ( v4 < 28 ); 14603 while ( v4 < 28 );
14821 dword_506E68 = -1; 14604 dword_506E68 = -1;
14822 v3->field_40 = 0; 14605 v3->field_40 = 0;
14823 } 14606 }
14824 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb] : 0)); 14607 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[0]] : 0));
14825 if ( KeyboardPageNum == 1 ) 14608 if ( KeyboardPageNum == 1 )
14826 { 14609 {
14827 pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb_1 != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb_1] : 0)); 14610 pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb[3] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[3]] : 0));
14828 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0); 14611 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0);
14829 v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]); 14612 v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]);
14830 v7 = sub_414D24(0); 14613 v7 = sub_414D24(0);
14831 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v7, v6, 0, 0, 0); 14614 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v7, v6, 0, 0, 0);
14832 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2D50, 0, 0, 0); 14615 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2D50, 0, 0, 0);
14885 v62 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]); 14668 v62 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]);
14886 v61 = 13; 14669 v61 = 13;
14887 } 14670 }
14888 else 14671 else
14889 { 14672 {
14890 pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb_2 != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb_2] : 0)); 14673 pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb[4] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[4]] : 0));
14891 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0); 14674 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0);
14892 v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]); 14675 v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]);
14893 v34 = sub_414D24(14); 14676 v34 = sub_414D24(14);
14894 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v34, v33, 0, 0, 0); 14677 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v34, v33, 0, 0, 0);
14895 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2CD4, 0, 0, 0); 14678 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2CD4, 0, 0, 0);
14972 else 14755 else
14973 result = v2; 14756 result = v2;
14974 } 14757 }
14975 else 14758 else
14976 { 14759 {
14977 if ( *((char *)word_506E6C + v1) ) 14760 if ( KeyButtonFlagChangesArray[v1] )
14978 result = dword_507C08; 14761 result = dword_507C08;
14979 } 14762 }
14980 return result; 14763 return result;
14981 } 14764 }
14982 // 506E68: using guessed type int dword_506E68; 14765 // 506E68: using guessed type int dword_506E68;
15049 void __cdecl DrawGameOptions() 14832 void __cdecl DrawGameOptions()
15050 { 14833 {
15051 signed int v0; // eax@1 14834 signed int v0; // eax@1
15052 14835
15053 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0)); 14836 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0));
15054 pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG] : 0)); 14837 pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[0]] : 0));
15055 v0 = 0; 14838 v0 = 0;
15056 if ( uTurnSpeed == 128 ) 14839 if ( uTurnSpeed == 128 )
15057 { 14840 {
15058 v0 = 2; 14841 v0 = 2;
15059 } 14842 }
15060 else 14843 else
15061 { 14844 {
15062 if ( uTurnSpeed == 64 ) 14845 if ( uTurnSpeed == 64 )
15063 v0 = 1; 14846 v0 = 1;
15064 } 14847 }
15065 pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_Con_Smoo[v0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Con_Smoo[v0]] : 0)); 14848 pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_ControlBG[v0 + 1] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[v0 + 1]] : 0));
15066 if ( bWalkSound ) 14849 if ( bWalkSound )
15067 pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_Option01 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option01] : 0)); 14850 pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_ControlBG[21] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[21]] : 0));
15068 if ( bShowDamage ) 14851 if ( bShowDamage )
15069 pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_Option02 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option02] : 0)); 14852 pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_ControlBG[22] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[22]] : 0));
15070 if ( bFlipOnExit ) 14853 if ( bFlipOnExit )
15071 pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_Option04 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option04] : 0)); 14854 pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_ControlBG[9] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[9]] : 0));
15072 if ( bAlwaysRun ) 14855 if ( bAlwaysRun )
15073 pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_Option03 != -1 ? &pIcons_LOD->pTextures[uTextureID_Option03] : 0)); 14856 pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_ControlBG[20] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[20]] : 0));
15074 pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162, 14857 pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162,
15075 (Texture *)(pTextureIDs_SoundLevels[(char)uSoundVolumeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uSoundVolumeMultiplier]] : 0)); 14858 (Texture *)(uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10]] : 0));
15076 pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216, 14859 pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216,
15077 (Texture *)(pTextureIDs_SoundLevels[(char)uMusicVolimeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uMusicVolimeMultiplier]] : 0)); 14860 (Texture *)(uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10]] : 0));
15078 pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270, 14861 pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270,
15079 (Texture *)(pTextureIDs_SoundLevels[(char)uVoicesVolumeMultiplier] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_SoundLevels[(char)uVoicesVolumeMultiplier]] : 0)); 14862 (Texture *)(uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10]] : 0));
15080 } 14863 }
15081 14864
15082 14865
15083 14866
15084 14867