Mercurial > mm7
comparison mm7_5.cpp @ 975:e875f5ab0cfb
Слияние
author | Ritor1 |
---|---|
date | Wed, 08 May 2013 17:36:45 +0600 |
parents | 8a6b995a84a5 35f2e900618e |
children | ac85898f5903 |
comparison
equal
deleted
inserted
replaced
974:8a6b995a84a5 | 975:e875f5ab0cfb |
---|---|
3303 signed int v4; // eax@29 | 3303 signed int v4; // eax@29 |
3304 int v5; // ecx@29 | 3304 int v5; // ecx@29 |
3305 PLAYER_SKILL_TYPE v6; // edi@37 | 3305 PLAYER_SKILL_TYPE v6; // edi@37 |
3306 GUIWindow *pWindow; // eax@56 | 3306 GUIWindow *pWindow; // eax@56 |
3307 GUIButton *pButton; // eax@59 | 3307 GUIButton *pButton; // eax@59 |
3308 //int v15; // edi@70 | 3308 int v15; // edi@70 |
3309 //char v16; // zf@73 | |
3310 char v20; // dl@116 | 3309 char v20; // dl@116 |
3311 unsigned int v21; // eax@116 | 3310 unsigned int v21; // eax@116 |
3312 unsigned int v25; // eax@120 | 3311 unsigned int v25; // eax@120 |
3313 unsigned int v26; // ecx@127 | 3312 unsigned int v26; // ecx@127 |
3314 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | 3313 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 |
3315 signed int v41; // [sp-10h] [bp-20h]@29 | 3314 signed int v41; // [sp-10h] [bp-20h]@29 |
3316 int uNum; // [sp+4h] [bp-Ch]@3 | 3315 int pParam; // [sp+4h] [bp-Ch]@3 |
3317 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 | 3316 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 |
3318 int pSex; // [sp+Ch] [bp-4h]@3 | 3317 int pSex; // [sp+Ch] [bp-4h]@3 |
3319 | 3318 |
3320 if ( pMessageQueue_50CBD0->uNumMessages ) | 3319 if ( pMessageQueue_50CBD0->uNumMessages ) |
3321 { | 3320 { |
3322 pPlayer = pParty->pPlayers; | 3321 pPlayer = pParty->pPlayers; |
3323 do | 3322 do |
3324 { | 3323 { |
3325 int param2; | 3324 int param2; |
3326 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, ¶m2); | 3325 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); |
3327 auto player = &pParty->pPlayers[uNum]; | 3326 auto player = &pParty->pPlayers[pParam]; |
3328 | 3327 |
3329 switch (pUIMessageType) // For buttons of window MainMenu | 3328 switch (pUIMessageType) // For buttons of window MainMenu |
3330 { | 3329 { |
3331 case UIMSG_MainMenu_ShowPartyCreationWnd: | 3330 case UIMSG_MainMenu_ShowPartyCreationWnd: |
3332 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | 3331 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); |
3344 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | 3343 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); |
3345 SetCurrentMenuID(MENU_FINISHED); | 3344 SetCurrentMenuID(MENU_FINISHED); |
3346 break; | 3345 break; |
3347 case UIMSG_PlayerCreation_SelectAttribute: | 3346 case UIMSG_PlayerCreation_SelectAttribute: |
3348 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3347 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3349 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3348 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3350 uPlayerCreationUI_SelectedCharacter = uNum; | 3349 uPlayerCreationUI_SelectedCharacter = pParam; |
3351 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3350 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3352 break; | 3351 break; |
3353 case UIMSG_PlayerCreation_VoicePrev: | 3352 case UIMSG_PlayerCreation_VoicePrev: |
3354 pSex = player->GetSexByVoice(); | 3353 pSex = player->GetSexByVoice(); |
3355 do | 3354 do |
3357 if (player->uVoiceID == 0) | 3356 if (player->uVoiceID == 0) |
3358 player->uVoiceID = 19; | 3357 player->uVoiceID = 19; |
3359 else --player->uVoiceID; | 3358 else --player->uVoiceID; |
3360 } | 3359 } |
3361 while (player->GetSexByVoice() != pSex); | 3360 while (player->GetSexByVoice() != pSex); |
3362 pButton = pCreationUI_BtnPressLeft2[uNum]; | 3361 pButton = pCreationUI_BtnPressLeft2[pParam]; |
3363 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); | 3362 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); |
3364 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3363 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3365 player->PlaySound(SPEECH_PickMe, 0); | 3364 player->PlaySound(SPEECH_PickMe, 0); |
3366 break; | 3365 break; |
3367 case UIMSG_PlayerCreation_VoiceNext: | 3366 case UIMSG_PlayerCreation_VoiceNext: |
3369 do | 3368 do |
3370 { | 3369 { |
3371 player->uVoiceID = (player->uVoiceID + 1) % 20; | 3370 player->uVoiceID = (player->uVoiceID + 1) % 20; |
3372 } | 3371 } |
3373 while (player->GetSexByVoice() != pSex); | 3372 while (player->GetSexByVoice() != pSex); |
3374 pButton = pCreationUI_BtnPressRight2[uNum]; | 3373 pButton = pCreationUI_BtnPressRight2[pParam]; |
3375 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); | 3374 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); |
3376 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3375 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3377 player->PlaySound(SPEECH_PickMe, 0); | 3376 player->PlaySound(SPEECH_PickMe, 0); |
3378 break; | 3377 break; |
3379 case UIMSG_PlayerCreation_FacePrev: | 3378 case UIMSG_PlayerCreation_FacePrev: |
3380 pPlayer = &pParty->pPlayers[uNum]; | 3379 pPlayer = &pParty->pPlayers[pParam]; |
3381 if (!pPlayer->uFace) | 3380 if (!pPlayer->uFace) |
3382 pPlayer->uFace = 19; | 3381 pPlayer->uFace = 19; |
3383 else | 3382 else |
3384 pPlayer->uFace -= 1; | 3383 pPlayer->uFace -= 1; |
3385 pPlayer->uVoiceID = pPlayer->uFace; | 3384 pPlayer->uVoiceID = pPlayer->uFace; |
3386 pPlayer->SetInitialStats(); | 3385 pPlayer->SetInitialStats(); |
3387 pPlayer->SetSexByVoice(); | 3386 pPlayer->SetSexByVoice(); |
3388 pPlayer->RandomizeName(); | 3387 pPlayer->RandomizeName(); |
3389 v25 = uNum; | 3388 v25 = pParam; |
3390 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3389 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3391 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3390 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3392 uPlayerCreationUI_SelectedCharacter = v25; | 3391 uPlayerCreationUI_SelectedCharacter = v25; |
3393 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], 1); | 3392 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], 1); |
3394 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); | 3393 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); |
3395 pPlayer->PlaySound(SPEECH_PickMe, 0); | 3394 pPlayer->PlaySound(SPEECH_PickMe, 0); |
3396 break; | 3395 break; |
3397 case UIMSG_PlayerCreation_FaceNext: | 3396 case UIMSG_PlayerCreation_FaceNext: |
3398 pPlayer = &pParty->pPlayers[uNum]; | 3397 pPlayer = &pParty->pPlayers[pParam]; |
3399 v20 = (char)((int)pPlayer->uFace + 1) % 20; | 3398 v20 = (char)((int)pPlayer->uFace + 1) % 20; |
3400 pPlayer->uFace = v20; | 3399 pPlayer->uFace = v20; |
3401 pPlayer->uVoiceID = v20; | 3400 pPlayer->uVoiceID = v20; |
3402 pPlayer->SetInitialStats(); | 3401 pPlayer->SetInitialStats(); |
3403 pPlayer->SetSexByVoice(); | 3402 pPlayer->SetSexByVoice(); |
3404 pPlayer->RandomizeName(); | 3403 pPlayer->RandomizeName(); |
3405 v21 = uNum; | 3404 v21 = pParam; |
3406 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3405 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3407 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3406 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3408 uPlayerCreationUI_SelectedCharacter = v21; | 3407 uPlayerCreationUI_SelectedCharacter = v21; |
3409 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], 1); | 3408 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], 1); |
3410 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3409 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3411 pPlayer->PlaySound(SPEECH_PickMe, 0); | 3410 pPlayer->PlaySound(SPEECH_PickMe, 0); |
3412 break; | 3411 break; |
3420 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | 3419 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3421 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | 3420 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); |
3422 break; | 3421 break; |
3423 case UIMSG_PlayerCreationSelectActiveSkill: | 3422 case UIMSG_PlayerCreationSelectActiveSkill: |
3424 pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter]; | 3423 pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter]; |
3425 v6 = pPlayer->GetSkillIdxByOrder(uNum + 4); | 3424 v6 = pPlayer->GetSkillIdxByOrder(pParam + 4); |
3426 if ( pPlayer->GetSkillIdxByOrder(3) == 37 ) | 3425 if ( pPlayer->GetSkillIdxByOrder(3) == 37 ) |
3427 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | 3426 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; |
3428 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | 3427 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); |
3429 break; | 3428 break; |
3430 case UIMSG_PlayerCreationSelectClass: | 3429 case UIMSG_PlayerCreationSelectClass: |
3431 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); | 3430 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); |
3432 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3431 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3433 break; | 3432 break; |
3434 case UIMSG_PlayerCreationClickOK: | 3433 case UIMSG_PlayerCreationClickOK: |
3435 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); | 3434 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); |
3436 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) | 3435 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) |
3441 case UIMSG_PlayerCreationClickReset: | 3440 case UIMSG_PlayerCreationClickReset: |
3442 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); | 3441 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); |
3443 pParty->Reset(); | 3442 pParty->Reset(); |
3444 break; | 3443 break; |
3445 case UIMSG_PlayerCreationRemoveUpSkill: | 3444 case UIMSG_PlayerCreationRemoveUpSkill: |
3446 uPlayerCreationUI_SelectedCharacter = uNum; | 3445 uPlayerCreationUI_SelectedCharacter = pParam; |
3447 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | 3446 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3448 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | 3447 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3449 v41 = 2; | 3448 v41 = 2; |
3450 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3449 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3451 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; | 3450 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; |
3452 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | 3451 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) |
3453 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | 3452 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
3454 break; | 3453 break; |
3455 case UIMSG_PlayerCreationChangeName: | 3454 case UIMSG_PlayerCreationChangeName: |
3456 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | 3455 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); |
3457 v3 = (void *)uNum; | 3456 v3 = (void *)pParam; |
3458 uPlayerCreationUI_SelectedCharacter = uNum; | 3457 uPlayerCreationUI_SelectedCharacter = pParam; |
3459 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | 3458 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); |
3460 pGUIWindow_CurrentMenu->ptr_1C = v3; | 3459 pGUIWindow_CurrentMenu->ptr_1C = v3; |
3461 break; | 3460 break; |
3462 case UIMSG_ChangeGameState: | 3461 case UIMSG_ChangeGameState: |
3463 uGameState = 1; | 3462 uGameState = 1; |
3475 break; | 3474 break; |
3476 case UIMSG_SelectLoadSlot: | 3475 case UIMSG_SelectLoadSlot: |
3477 //main menu save/load wnd clicking on savegame lines | 3476 //main menu save/load wnd clicking on savegame lines |
3478 if (pGUIWindow_CurrentMenu->field_40 == 1) | 3477 if (pGUIWindow_CurrentMenu->field_40 == 1) |
3479 pKeyActionMap->_459ED1(0); | 3478 pKeyActionMap->_459ED1(0); |
3480 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition ) | 3479 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) |
3481 { | 3480 { |
3482 //load clicked line | 3481 //load clicked line |
3483 v26 = uNum + pSaveListPosition; | 3482 v26 = pParam + pSaveListPosition; |
3484 if ( dword_6BE138 == uNum + pSaveListPosition ) | 3483 if ( dword_6BE138 == pParam + pSaveListPosition ) |
3485 { | 3484 { |
3486 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | 3485 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); |
3487 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | 3486 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
3488 } | 3487 } |
3489 uLoadGameUI_SelectedSlot = v26; | 3488 uLoadGameUI_SelectedSlot = v26; |
3500 case UIMSG_SaveLoadBtn: | 3499 case UIMSG_SaveLoadBtn: |
3501 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | 3500 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); |
3502 break; | 3501 break; |
3503 case UIMSG_DownArrow: | 3502 case UIMSG_DownArrow: |
3504 ++pSaveListPosition; | 3503 ++pSaveListPosition; |
3505 if ( pSaveListPosition >= uNum ) | 3504 if ( pSaveListPosition >= pParam ) |
3506 pSaveListPosition = uNum - 1; | 3505 pSaveListPosition = pParam - 1; |
3507 if ( pSaveListPosition < 1 ) | 3506 if ( pSaveListPosition < 1 ) |
3508 pSaveListPosition = 0; | 3507 pSaveListPosition = 0; |
3509 pWindow = pGUIWindow_CurrentMenu; | 3508 pWindow = pGUIWindow_CurrentMenu; |
3510 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | 3509 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); |
3511 break; | 3510 break; |
3533 sub_41426F(); | 3532 sub_41426F(); |
3534 break; | 3533 break; |
3535 } | 3534 } |
3536 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) | 3535 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) |
3537 break; | 3536 break; |
3537 v15 = 1; | |
3538 pVideoPlayer->bStopBeforeSchedule = 1; | 3538 pVideoPlayer->bStopBeforeSchedule = 1; |
3539 viewparams->bRedrawGameUI = 1; | 3539 viewparams->bRedrawGameUI = 1; |
3540 viewparams->field_48 = 1; | 3540 viewparams->field_48 = 1; |
3541 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) | 3541 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) |
3542 { | 3542 { |
3545 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | 3545 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
3546 { | 3546 { |
3547 SetCurrentMenuID(MENU_CREATEPARTY); | 3547 SetCurrentMenuID(MENU_CREATEPARTY); |
3548 break; | 3548 break; |
3549 } | 3549 } |
3550 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
3551 { | |
3552 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
3553 break; | |
3554 } | |
3550 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | 3555 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); |
3551 break; | 3556 break; |
3552 } | 3557 } |
3553 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) | 3558 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) |
3554 { | 3559 { |
3555 SetCurrentMenuID(MENU_CREDITSCLOSE); | 3560 if ( pCurrentScreen == SCREEN_VIDEO ) |
3561 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | |
3562 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | |
3563 { | |
3564 SetCurrentMenuID(MENU_CREATEPARTY); | |
3565 break; | |
3566 } | |
3567 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
3568 { | |
3569 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
3570 break; | |
3571 } | |
3572 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
3556 break; | 3573 break; |
3557 } | 3574 } |
3558 if ( pCurrentScreen == SCREEN_LOADGAME ) | 3575 if ( pCurrentScreen == SCREEN_LOADGAME ) |
3559 { | 3576 { |
3560 pIcons_LOD->_4114F2(); | 3577 pIcons_LOD->_4114F2(); |
3561 //crt_deconstruct_ptr_6A0118(); | 3578 //crt_deconstruct_ptr_6A0118(); |
3562 pTexture_PCX.Release(); | 3579 pTexture_PCX.Release(); |
3563 pTexture_PCX.Load("title.pcx", 0); | 3580 pTexture_PCX.Load("title.pcx", 0); |
3564 SetCurrentMenuID(MENU_MAIN); | 3581 SetCurrentMenuID(MENU_MAIN); |
3582 v15 = 1; | |
3565 pGUIWindow_CurrentMenu->Release(); | 3583 pGUIWindow_CurrentMenu->Release(); |
3566 pGUIWindow2->Release(); | 3584 pGUIWindow2->Release(); |
3567 pGUIWindow2 = 0; | 3585 pGUIWindow2 = 0; |
3568 pEventTimer->Resume(); | 3586 pEventTimer->Resume(); |
3569 pCurrentScreen = SCREEN_GAME; | 3587 pCurrentScreen = SCREEN_GAME; |
3570 viewparams->bRedrawGameUI = 1; | 3588 viewparams->bRedrawGameUI = v15; |
3571 break; | 3589 break; |
3572 } | 3590 } |
3573 if ( pCurrentScreen == SCREEN_VIDEO ) | 3591 if ( pCurrentScreen == SCREEN_VIDEO ) |
3574 { | 3592 { |
3575 pVideoPlayer->Unload(); | 3593 pVideoPlayer->Unload(); |
3581 pGUIWindow_CurrentMenu->Release(); | 3599 pGUIWindow_CurrentMenu->Release(); |
3582 pGUIWindow2->Release(); | 3600 pGUIWindow2->Release(); |
3583 pGUIWindow2 = 0; | 3601 pGUIWindow2 = 0; |
3584 pEventTimer->Resume(); | 3602 pEventTimer->Resume(); |
3585 pCurrentScreen = SCREEN_GAME; | 3603 pCurrentScreen = SCREEN_GAME; |
3586 viewparams->bRedrawGameUI = 1; | 3604 viewparams->bRedrawGameUI = v15; |
3587 break; | 3605 break; |
3588 } | 3606 } |
3589 //VideoPlayer::dtor(); | 3607 //VideoPlayer::dtor(); |
3590 } | 3608 } |
3591 break; | 3609 break; |
3592 case UIMSG_PlayerCreationRemoveDownSkill: | 3610 case UIMSG_PlayerCreationRemoveDownSkill: |
3593 uPlayerCreationUI_SelectedCharacter = uNum; | 3611 uPlayerCreationUI_SelectedCharacter = pParam; |
3594 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 | 3612 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 |
3595 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3613 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3596 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) | 3614 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) |
3597 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | 3615 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
3598 break; | 3616 break; |
3599 default: | 3617 default: |
3600 break; | 3618 break; |
10164 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[157], 3u); | 10182 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[157], 3u); |
10165 } | 10183 } |
10166 | 10184 |
10167 | 10185 |
10168 | 10186 |
10169 | |
10170 //----- (004156F0) -------------------------------------------------------- | 10187 //----- (004156F0) -------------------------------------------------------- |
10171 void __cdecl GUI_UpdateWindows() // | 10188 void __cdecl GUI_UpdateWindows() |
10172 { | 10189 { |
10173 GUIWindow *pWindow; // esi@4 | 10190 GUIWindow *pWindow; // esi@4 |
10174 unsigned int pWindowType; // eax@4 | 10191 unsigned int pWindowType; // eax@4 |
10175 int v2; // eax@10 | |
10176 int v3; // eax@11 | |
10177 int v4; // eax@12 | |
10178 int v5; // eax@20 | |
10179 int v6; // eax@21 | |
10180 int v7; // eax@29 | |
10181 int v8; // eax@30 | |
10182 int v9; // eax@31 | |
10183 void *v10; // eax@41 | |
10184 int v11; // ecx@42 | |
10185 int v12; // eax@48 | |
10186 int v13; // eax@49 | |
10187 int v14; // eax@57 | |
10188 int v15; // eax@58 | |
10189 int v16; // eax@59 | |
10190 int v17; // eax@60 | |
10191 int v18; // eax@61 | |
10192 int v19; // eax@62 | |
10193 void *v20; // ebp@66 | |
10194 char *pHint; // edx@66 | 10192 char *pHint; // edx@66 |
10195 GUIButton *pButtonPtr_1C; // ebp@79 | 10193 GUIButton *pButtonPtr_1C; // ebp@79 |
10196 char *pHint1; // edx@80 | 10194 char *pHint1; // edx@80 |
10197 char v24; // zf@81 | |
10198 //unsigned int v25; // eax@91 | |
10199 int v26; // eax@98 | 10195 int v26; // eax@98 |
10200 unsigned int v27; // ebp@106 | 10196 unsigned int v27; // ebp@106 |
10201 GUIWindow *pGUIWindow2; // ecx@109 | 10197 GUIWindow *pGUIWindow2; // ecx@109 |
10202 unsigned int v29; // eax@111 | |
10203 GUIFont *pGUIFont; // ST1C_4@115 | 10198 GUIFont *pGUIFont; // ST1C_4@115 |
10204 int v31; // eax@115 | 10199 int v31; // eax@115 |
10205 GUIButton *pButton; // ebp@118 | 10200 GUIButton *pButton; // ebp@118 |
10206 int v33; // eax@119 | |
10207 int v34; // eax@120 | |
10208 int v35; // eax@121 | |
10209 int v36; // eax@122 | |
10210 int v37; // eax@123 | |
10211 int v38; // eax@124 | |
10212 int v39; // eax@129 | 10201 int v39; // eax@129 |
10213 //char *v40; // edx@138 | |
10214 unsigned int pNumMessages; // eax@142 | 10202 unsigned int pNumMessages; // eax@142 |
10215 GUIButton *pGUIButton; // ebp@146 | 10203 GUIButton *pGUIButton; // ebp@146 |
10216 //char *v43; // edx@146 | |
10217 unsigned int pX; // [sp-1Ch] [bp-124h]@17 | 10204 unsigned int pX; // [sp-1Ch] [bp-124h]@17 |
10218 unsigned int pY; // [sp-18h] [bp-120h]@17 | 10205 unsigned int pY; // [sp-18h] [bp-120h]@17 |
10219 Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | 10206 Texture *pTexture; // [sp-14h] [bp-11Ch]@17 |
10220 Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | 10207 Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 |
10221 int i; // [sp+0h] [bp-108h]@3 | 10208 int i; // [sp+0h] [bp-108h]@3 |
10225 | 10212 |
10226 if (GetCurrentMenuID() != MENU_CREATEPARTY) | 10213 if (GetCurrentMenuID() != MENU_CREATEPARTY) |
10227 sub_41CD4F(34); | 10214 sub_41CD4F(34); |
10228 for ( i = 1; i <= uNumVisibleWindows; ++i ) | 10215 for ( i = 1; i <= uNumVisibleWindows; ++i ) |
10229 { | 10216 { |
10230 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; | |
10231 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; | 10217 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; |
10232 pWindowType = pWindow->eWindowType; | 10218 pWindowType = pWindow->eWindowType; |
10233 switch (pWindow->eWindowType) | 10219 switch (pWindow->eWindowType) |
10234 { | 10220 { |
10235 case WINDOW_OptionsButtons://3 | 10221 case WINDOW_OptionsButtons: |
10236 { | 10222 { |
10237 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0); | 10223 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0); |
10238 pY = pViewport->uViewportTL_Y; | 10224 pY = pViewport->uViewportTL_Y; |
10239 pX = pViewport->uViewportTL_X; | 10225 pX = pViewport->uViewportTL_X; |
10240 pRenderer->DrawTextureIndexed(pX, pY, pTexture); | 10226 pRenderer->DrawTextureIndexed(pX, pY, pTexture); |
10241 viewparams->bRedrawGameUI = 1; | 10227 viewparams->bRedrawGameUI = 1; |
10242 continue; | 10228 continue; |
10243 } | 10229 } |
10244 case WINDOW_CharacterRecord://4 | 10230 case WINDOW_CharacterRecord: |
10245 { | 10231 { |
10246 CharacterUI_CharacterScreen_Draw(uActiveCharacter); | 10232 CharacterUI_CharacterScreen_Draw(uActiveCharacter); |
10247 continue; | 10233 continue; |
10248 } | 10234 } |
10249 case WINDOW_Options://6 | 10235 case WINDOW_Options: |
10250 { | 10236 { |
10251 DrawGameOptions(); | 10237 DrawGameOptions(); |
10252 continue; | 10238 continue; |
10253 } | 10239 } |
10254 case WINDOW_Book://9 | 10240 case WINDOW_Book: |
10255 { | 10241 { |
10256 DrawCurrentBook((unsigned int)pWindow->ptr_1C); | 10242 DrawCurrentBook((unsigned int)pWindow->ptr_1C); |
10257 continue; | 10243 continue; |
10258 } | 10244 } |
10259 case WINDOW_Dialogue://10 | 10245 case WINDOW_Dialogue: |
10260 { | 10246 { |
10261 DrawDialogueUI(); | 10247 DrawDialogueUI(); |
10262 continue; | 10248 continue; |
10263 } | 10249 } |
10264 case WINDOW_QuickReference://12 | 10250 case WINDOW_QuickReference: |
10265 { | 10251 { |
10266 QuickRefDraw(); | 10252 QuickRefDraw(); |
10267 continue; | 10253 continue; |
10268 } | 10254 } |
10269 case WINDOW_Rest://16 | 10255 case WINDOW_Rest: |
10270 { | 10256 { |
10271 RestUI_Draw(); | 10257 RestUI_Draw(); |
10272 continue; | 10258 continue; |
10273 } | 10259 } |
10274 case WINDOW_ChangeLocation://17 | 10260 case WINDOW_ChangeLocation: |
10275 { | 10261 { |
10276 TravelUI_Draw(); | 10262 TravelUI_Draw(); |
10277 continue; | 10263 continue; |
10278 } | 10264 } |
10279 case WINDOW_SpellBook://18 | 10265 case WINDOW_SpellBook: |
10280 { | 10266 { |
10281 DrawSpellBookContent(); | 10267 DrawSpellBookContent(); |
10282 continue; | 10268 continue; |
10283 } | 10269 } |
10284 case WINDOW_GreetingNPC://19 | 10270 case WINDOW_GreetingNPC: |
10285 { | 10271 { |
10286 DrawBranchlessDialogueUI(); | 10272 DrawBranchlessDialogueUI(); |
10287 continue; | 10273 continue; |
10288 } | 10274 } |
10289 case WINDOW_Chest://20 | 10275 case WINDOW_Chest: |
10290 { | 10276 { |
10291 if ( pCurrentScreen == SCREEN_CHEST ) | 10277 if ( pCurrentScreen == SCREEN_CHEST ) |
10292 { | 10278 { |
10293 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); | 10279 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); |
10294 } | 10280 } |
10300 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | 10286 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, |
10301 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); | 10287 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); |
10302 } | 10288 } |
10303 continue; | 10289 continue; |
10304 } | 10290 } |
10305 case WINDOW_SaveLoadButtons://23 | 10291 case WINDOW_SaveLoadButtons: |
10306 { | 10292 { |
10307 sub_4606FE(); | 10293 sub_4606FE(); |
10308 continue; | 10294 continue; |
10309 } | 10295 } |
10310 case WINDOW_MainMenu_Load://24 | 10296 case WINDOW_MainMenu_Load: |
10311 { | 10297 { |
10312 GameUI_MainMenu_DrawLoad(); | 10298 GameUI_MainMenu_DrawLoad(); |
10313 continue; | 10299 continue; |
10314 } | 10300 } |
10315 case WINDOW_HouseInterior://25 | 10301 case WINDOW_HouseInterior: |
10316 { | 10302 { |
10317 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); | 10303 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); |
10318 if ( !window_SpeakInHouse ) | 10304 if ( !window_SpeakInHouse ) |
10319 continue; | 10305 continue; |
10320 v10 = window_SpeakInHouse->ptr_1C; | 10306 if ( (signed int)window_SpeakInHouse->ptr_1C >= 53 ) |
10321 if ( (signed int)v10 >= 53 ) | |
10322 continue; | 10307 continue; |
10323 if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed ) | 10308 if ( pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] <=pParty->uTimePlayed ) |
10324 { | 10309 { |
10325 if ( (signed int)v10 < 53 ) | 10310 if ( (signed int)window_SpeakInHouse->ptr_1C < 53 ) |
10326 { | 10311 { |
10327 pParty->field_3C._shop_ban_times[(signed int)v10] = 0; | 10312 pParty->field_3C._shop_ban_times[(signed int)window_SpeakInHouse->ptr_1C] = 0; |
10328 } | 10313 } |
10329 continue; | 10314 continue; |
10330 } | 10315 } |
10331 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | 10316 pNumMessages = pMessageQueue_50CBD0->uNumMessages; |
10332 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10317 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10333 continue; | 10318 continue; |
10334 } | 10319 } |
10335 case WINDOW_Transition://26 | 10320 case WINDOW_Transition: |
10336 { | 10321 { |
10337 TransitionUI_Draw(); | 10322 TransitionUI_Draw(); |
10338 continue; | 10323 continue; |
10339 } | 10324 } |
10340 case WINDOW_Scroll://30 | 10325 case WINDOW_Scroll: |
10341 { | 10326 { |
10342 CreateScrollWindow(); | 10327 CreateScrollWindow(); |
10343 continue; | 10328 continue; |
10344 } | 10329 } |
10345 case WINDOW_CastSpell_InInventory://31 | 10330 case WINDOW_CastSpell_InInventory: |
10346 { | 10331 { |
10347 pRenderer->ClearZBuffer(0, 479); | 10332 pRenderer->ClearZBuffer(0, 479); |
10348 draw_leather(); | 10333 draw_leather(); |
10349 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 10334 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
10350 CharacterUI_DrawPaperdoll(uActiveCharacter); | 10335 CharacterUI_DrawPaperdoll(uActiveCharacter); |
10351 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | 10336 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, |
10352 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); | 10337 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); |
10353 continue; | 10338 continue; |
10354 } | 10339 } |
10355 case WINDOW_FinalWindow://70 | 10340 case WINDOW_FinalWindow: |
10356 { | 10341 { |
10357 sub_41420D_press_esc(); | 10342 sub_41420D_press_esc(); |
10358 continue; | 10343 continue; |
10359 } | 10344 } |
10360 case WINDOW_50://80 | 10345 case WINDOW_50: |
10361 { | 10346 { |
10362 v27 = TargetColor(255, 255, 255); | 10347 v27 = TargetColor(255, 255, 255); |
10363 if ( ptr_507BD0->field_40 == 1 ) | 10348 if ( ptr_507BD0->field_40 == 1 ) |
10364 { | 10349 { |
10365 ptr_507BD0->DrawMessageBox(0); | 10350 ptr_507BD0->DrawMessageBox(0); |
10368 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); | 10353 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); |
10369 continue; | 10354 continue; |
10370 } | 10355 } |
10371 if ( ptr_507BD0->field_40 == 2 ) | 10356 if ( ptr_507BD0->field_40 == 2 ) |
10372 { | 10357 { |
10373 //v29 = pMessageQueue_50CBD0->uNumMessages; | |
10374 pWindow->field_40 = 0; | 10358 pWindow->field_40 = 0; |
10375 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
10376 { | |
10377 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C; | |
10378 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
10379 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
10380 ++pMessageQueue_50CBD0->uNumMessages; | |
10381 }*/ | |
10382 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); | 10359 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); |
10383 pEventTimer->Resume(); | 10360 pEventTimer->Resume(); |
10384 ptr_507BD0->Release(); | 10361 ptr_507BD0->Release(); |
10385 pCurrentScreen = 0; | 10362 pCurrentScreen = 0; |
10386 viewparams->bRedrawGameUI = 1; | 10363 viewparams->bRedrawGameUI = 1; |
10392 pEventTimer->Resume(); | 10369 pEventTimer->Resume(); |
10393 ptr_507BD0->Release(); | 10370 ptr_507BD0->Release(); |
10394 continue; | 10371 continue; |
10395 } | 10372 } |
10396 } | 10373 } |
10397 case WINDOW_59://89 | 10374 case WINDOW_59: |
10398 { | 10375 { |
10399 pWindow->DrawMessageBox(0); | 10376 pWindow->DrawMessageBox(0); |
10400 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | 10377 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); |
10401 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | 10378 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
10402 if ( !pKeyActionMap->field_204 ) | 10379 if ( !pKeyActionMap->field_204 ) |
10428 } | 10405 } |
10429 } | 10406 } |
10430 } | 10407 } |
10431 continue; | 10408 continue; |
10432 } | 10409 } |
10433 case WINDOW_PressedButton2://90 | 10410 case WINDOW_PressedButton2: |
10434 { | 10411 { |
10435 if ( pWindow->Hint != (char *)1 ) | 10412 if ( pWindow->Hint != (char *)1 ) |
10436 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | 10413 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); |
10437 pButton = (GUIButton *)pWindow->ptr_1C; | 10414 pButton = (GUIButton *)pWindow->ptr_1C; |
10438 if ( pButton->uX >= 0 && pButton->uX <= 640 ) | 10415 if ( pButton->uX >= 0 && pButton->uX <= 640 ) |
10441 { | 10418 { |
10442 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | 10419 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); |
10443 viewparams->bRedrawGameUI = 1; | 10420 viewparams->bRedrawGameUI = 1; |
10444 if ( pWindow->Hint ) | 10421 if ( pWindow->Hint ) |
10445 { | 10422 { |
10446 v24 = pWindow->Hint == (char *)1; | 10423 if ( pWindow->Hint != (char *)1 ) |
10447 if ( !v24 ) | |
10448 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | 10424 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); |
10449 } | 10425 } |
10450 pWindow->Release(); | 10426 pWindow->Release(); |
10451 continue; | 10427 continue; |
10452 } | 10428 } |
10453 } | 10429 } |
10454 viewparams->bRedrawGameUI = 1; | 10430 viewparams->bRedrawGameUI = 1; |
10455 if ( pWindow->Hint ) | 10431 if ( pWindow->Hint ) |
10456 { | 10432 { |
10457 v24 = pWindow->Hint == (char *)1; | 10433 if ( pWindow->Hint != (char *)1 ) |
10458 if ( !v24 ) | |
10459 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | 10434 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); |
10460 } | 10435 } |
10461 pWindow->Release(); | 10436 pWindow->Release(); |
10462 continue; | 10437 continue; |
10463 } | 10438 } |
10464 case WINDOW_CharactersPressedButton://91 | 10439 case WINDOW_CharactersPressedButton: |
10465 { | 10440 { |
10466 if ( pWindow->Hint != (char *)1 ) | 10441 if ( pWindow->Hint != (char *)1 ) |
10467 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | 10442 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); |
10468 pButton = (GUIButton *)pWindow->ptr_1C; | 10443 pButton = (GUIButton *)pWindow->ptr_1C; |
10469 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | 10444 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); |
10470 viewparams->bRedrawGameUI = 1; | 10445 viewparams->bRedrawGameUI = 1; |
10471 if ( pWindow->Hint ) | 10446 if ( pWindow->Hint ) |
10472 { | 10447 { |
10473 v24 = pWindow->Hint == (char *)1; | 10448 if ( pWindow->Hint != (char *)1 ) |
10474 if ( !v24 ) | |
10475 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | 10449 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); |
10476 } | 10450 } |
10477 pWindow->Release(); | 10451 pWindow->Release(); |
10478 continue; | 10452 continue; |
10479 } | 10453 } |
10480 case WINDOW_PressedButton://92 | 10454 case WINDOW_PressedButton: |
10481 { | 10455 { |
10482 if ( pWindow->Hint != (char *)1 ) | 10456 if ( pWindow->Hint != (char *)1 ) |
10483 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | 10457 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); |
10484 pButton = (GUIButton *)pWindow->ptr_1C; | 10458 pButton = (GUIButton *)pWindow->ptr_1C; |
10485 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | 10459 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); |
10486 viewparams->bRedrawGameUI = 1; | 10460 viewparams->bRedrawGameUI = 1; |
10487 if ( pWindow->Hint ) | 10461 if ( pWindow->Hint ) |
10488 { | 10462 { |
10489 v24 = pWindow->Hint == (char *)1; | 10463 if ( pWindow->Hint != (char *)1 ) |
10490 if ( !v24 ) | |
10491 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | 10464 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); |
10492 } | 10465 } |
10493 pWindow->Release(); | 10466 pWindow->Release(); |
10494 continue; | 10467 continue; |
10495 } | 10468 } |
10496 case WINDOW_5D://93 | 10469 case WINDOW_5D: |
10497 { | 10470 { |
10498 if ( pWindow->Hint != (char *)1 ) | 10471 if ( pWindow->Hint != (char *)1 ) |
10499 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | 10472 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); |
10500 pButton = (GUIButton *)pWindow->ptr_1C; | 10473 pButton = (GUIButton *)pWindow->ptr_1C; |
10501 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | 10474 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); |
10502 viewparams->bRedrawGameUI = 1; | 10475 viewparams->bRedrawGameUI = 1; |
10503 pWindow->Release(); | 10476 pWindow->Release(); |
10504 continue; | 10477 continue; |
10505 } | 10478 } |
10506 case WINDOW_SaveLoadBtn://94 | 10479 case WINDOW_SaveLoadBtn: |
10507 { | 10480 { |
10508 if (pWindow->Hint != (char *)1) | 10481 if (pWindow->Hint != (char *)1) |
10509 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 10482 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
10510 pButton = (GUIButton *)pWindow->ptr_1C; | 10483 pButton = (GUIButton *)pWindow->ptr_1C; |
10511 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | 10484 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); |
10518 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); | 10491 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); |
10519 else | 10492 else |
10520 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | 10493 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
10521 continue; | 10494 continue; |
10522 } | 10495 } |
10523 case WINDOW_LoadGame_CancelBtn://95 | 10496 case WINDOW_LoadGame_CancelBtn: |
10524 { | 10497 { |
10525 if ( pWindow->Hint != (char *)1 ) | 10498 if ( pWindow->Hint != (char *)1 ) |
10526 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | 10499 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); |
10527 pButton = (GUIButton *)pWindow->ptr_1C; | 10500 pButton = (GUIButton *)pWindow->ptr_1C; |
10528 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | 10501 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); |
10529 viewparams->bRedrawGameUI = 1; | 10502 viewparams->bRedrawGameUI = 1; |
10530 if ( pWindow->Hint && pWindow->Hint != (char *)1 ) | 10503 if ( pWindow->Hint && pWindow->Hint != (char *)1 ) |
10531 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | 10504 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); |
10532 pWindow->Release(); | 10505 pWindow->Release(); |
10533 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
10534 { | |
10535 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | |
10536 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
10537 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
10538 ++pMessageQueue_50CBD0->uNumMessages; | |
10539 continue; | |
10540 }*/ | |
10541 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10506 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10542 continue; | 10507 continue; |
10543 } | 10508 } |
10544 case WINDOW_CloseRestWindowBtn://96 | 10509 case WINDOW_CloseRestWindowBtn: |
10545 { | 10510 { |
10546 if ( pWindow->Hint != (char *)1 ) | 10511 if ( pWindow->Hint != (char *)1 ) |
10547 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 10512 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
10548 pGUIButton = (GUIButton *)pWindow->ptr_1C; | 10513 pGUIButton = (GUIButton *)pWindow->ptr_1C; |
10549 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | 10514 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); |
10553 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | 10518 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); |
10554 pWindow->Release(); | 10519 pWindow->Release(); |
10555 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10520 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10556 continue; | 10521 continue; |
10557 } | 10522 } |
10558 case WINDOW_ExitCharacterWindow://97 | 10523 case WINDOW_ExitCharacterWindow: |
10559 { | 10524 { |
10560 if ( pWindow->Hint != (char *)1 ) | 10525 if ( pWindow->Hint != (char *)1 ) |
10561 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 10526 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
10562 pButton = (GUIButton *)pWindow->ptr_1C; | 10527 pButton = (GUIButton *)pWindow->ptr_1C; |
10563 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | 10528 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); |
10568 pWindow->Release(); | 10533 pWindow->Release(); |
10569 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | 10534 pNumMessages = pMessageQueue_50CBD0->uNumMessages; |
10570 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10535 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10571 continue; | 10536 continue; |
10572 } | 10537 } |
10573 case WINDOW_RestWindow://98 | 10538 case WINDOW_RestWindow: |
10574 { | 10539 { |
10575 memset(&GUIButton2, 0, 0xBCu); | 10540 memset(&GUIButton2, 0, 0xBCu); |
10576 GUIButton2.uZ = 197; | 10541 GUIButton2.uZ = 197; |
10577 GUIButton2.uW = 197; | 10542 GUIButton2.uW = 197; |
10578 GUIButton2.uX = 27; | 10543 GUIButton2.uX = 27; |
10587 GUIButton2.pParent = 0; | 10552 GUIButton2.pParent = 0; |
10588 pGUIWindow2 = pWindow; | 10553 pGUIWindow2 = pWindow; |
10589 pGUIWindow2->Release(); | 10554 pGUIWindow2->Release(); |
10590 continue; | 10555 continue; |
10591 } | 10556 } |
10592 case WINDOW_BooksWindow://99 | 10557 case WINDOW_BooksWindow: |
10593 { | 10558 { |
10594 pButton = (GUIButton *)pWindow->ptr_1C; | 10559 pButton = (GUIButton *)pWindow->ptr_1C; |
10595 pY = pWindow->uFrameY; | 10560 pY = pWindow->uFrameY; |
10596 pX = pWindow->uFrameX; | 10561 pX = pWindow->uFrameX; |
10597 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]); | 10562 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]); |
10598 viewparams->bRedrawGameUI = 1; | 10563 viewparams->bRedrawGameUI = 1; |
10599 continue; | 10564 continue; |
10600 } | 10565 } |
10601 case WINDOW_CharacterWindow_Inventory://103 | 10566 case WINDOW_CharacterWindow_Inventory: |
10602 { | 10567 { |
10603 pWindow->DrawMessageBox(0); | 10568 pWindow->DrawMessageBox(0); |
10604 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | 10569 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); |
10605 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | 10570 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
10606 if ( !pKeyActionMap->field_204 ) | 10571 if ( !pKeyActionMap->field_204 ) |
10617 SpawnActor(v39); | 10582 SpawnActor(v39); |
10618 } | 10583 } |
10619 } | 10584 } |
10620 continue; | 10585 continue; |
10621 } | 10586 } |
10622 case WINDOW_KeyMappingOptions://105 | 10587 case WINDOW_KeyMappingOptions: |
10623 { | 10588 { |
10624 GameMenuUI_DrawKeyBindings(); | 10589 GameMenuUI_DrawKeyBindings(); |
10625 continue; | 10590 continue; |
10626 } | 10591 } |
10627 case WINDOW_VideoOptions://106 | 10592 case WINDOW_VideoOptions: |
10628 { | 10593 { |
10629 GameMenuUI_DrawVideoOptions(); | 10594 GameMenuUI_DrawVideoOptions(); |
10630 continue; | 10595 continue; |
10631 } | 10596 } |
10632 default: | 10597 default: |