comparison mm7_5.cpp @ 151:9abdd40a107b

pCurrentScreen
author Ritor1
date Tue, 12 Feb 2013 15:28:08 +0600
parents d92c78ab54fe
children f4ebd13c2a8e
comparison
equal deleted inserted replaced
150:d92c78ab54fe 151:9abdd40a107b
330 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID; 330 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID;
331 pActor = &pActors[uMessageParam]; 331 pActor = &pActors[uMessageParam];
332 //goto _actor_init_dlg; 332 //goto _actor_init_dlg;
333 pActor->InitializeDialogue(v0); 333 pActor->InitializeDialogue(v0);
334 continue; 334 continue;
335 case UIMSG_Quit|0x2: 335 case UIMSG_86:
336 case 0x87: 336 case UIMSG_87:
337 if ( bNoNPCHiring != 1 && !pCurrentScreen ) 337 if ( bNoNPCHiring != 1 && !pCurrentScreen )
338 { 338 {
339 if ( pMessageQueue_50CBD0->uNumMessages ) 339 if ( pMessageQueue_50CBD0->uNumMessages )
340 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 340 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
341 uAction = 0; 341 uAction = 0;
380 //_actor_init_dlg: 380 //_actor_init_dlg:
381 pActor->InitializeDialogue(v0); 381 pActor->InitializeDialogue(v0);
382 } 382 }
383 } 383 }
384 continue; 384 continue;
385 case 0x51: 385 case UIMSG_51:
386 sub_4BDB56_buy_skill____(); 386 sub_4BDB56_buy_skill____();
387 continue; 387 continue;
388 case UIMSG_AF: 388 case UIMSG_AF:
389 sub_4B2001(uMessageParam); 389 sub_4B2001(uMessageParam);
390 continue; 390 continue;
391 case 0x195: 391 case UIMSG_195:
392 sub_4BCACC_bounties(uMessageParam); 392 sub_4BCACC_bounties(uMessageParam);
393 continue; 393 continue;
394 case 0x88: 394 case UIMSG_88:
395 sub_4BC49B(uMessageParam); 395 sub_4BC49B(uMessageParam);
396 continue; 396 continue;
397 case 0x19A: 397 case UIMSG_19A:
398 _4B4224_UpdateNPCTopics(uMessageParam); 398 _4B4224_UpdateNPCTopics(uMessageParam);
399 continue; 399 continue;
400 case UIMSG_StartNewGame: 400 case UIMSG_StartNewGame:
401 if ( dword_6BE138 == 124 || uMessageParam ) 401 if ( dword_6BE138 == 124 || uMessageParam )
402 { 402 {
405 if ( pMessageQueue_50CBD0->uNumMessages ) 405 if ( pMessageQueue_50CBD0->uNumMessages )
406 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 406 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
407 pGUIWindow_CurrentMenu->Release(); 407 pGUIWindow_CurrentMenu->Release();
408 uGameState = 4; 408 uGameState = 4;
409 LABEL_188: 409 LABEL_188:
410 pCurrentScreen = 0; 410 pCurrentScreen = SCREEN_GAME;
411 viewparams->bRedrawGameUI = v0; 411 viewparams->bRedrawGameUI = v0;
412 } 412 }
413 else 413 else
414 { 414 {
415 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game" 415 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game"
423 pIcons_LOD->_40F9C5(); 423 pIcons_LOD->_40F9C5();
424 pIcons_LOD->_4114F2(); 424 pIcons_LOD->_4114F2();
425 if ( pMessageQueue_50CBD0->uNumMessages ) 425 if ( pMessageQueue_50CBD0->uNumMessages )
426 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 426 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
427 pGUIWindow_CurrentMenu->Release(); 427 pGUIWindow_CurrentMenu->Release();
428 pCurrentScreen = 12; 428 pCurrentScreen = SCREEN_LOADGAME;
429 GameUI_DrawLoadMenu(v0); 429 GameUI_DrawLoadMenu(v0);
430 continue; 430 continue;
431 case UIMSG_Quit: 431 case UIMSG_Quit:
432 if ( dword_6BE138 == 132 || uMessageParam ) 432 if ( dword_6BE138 == 132 || uMessageParam )
433 { 433 {
434 pIcons_LOD->_40F9C5(); 434 pIcons_LOD->_40F9C5();
435 pIcons_LOD->_4114F2(); 435 pIcons_LOD->_4114F2();
436 if ( pMessageQueue_50CBD0->uNumMessages ) 436 if ( pMessageQueue_50CBD0->uNumMessages )
437 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 437 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
438 pGUIWindow_CurrentMenu->Release(); 438 pGUIWindow_CurrentMenu->Release();
439 pCurrentScreen = 0; 439 pCurrentScreen = SCREEN_GAME;
440 viewparams->bRedrawGameUI = v0; 440 viewparams->bRedrawGameUI = v0;
441 if ( !uMessageParam ) 441 if ( !uMessageParam )
442 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); 442 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
443 uGameState = 7; 443 uGameState = 7;
444 } 444 }
449 dword_6BE138 = 132; 449 dword_6BE138 = 132;
450 } 450 }
451 //goto _release_tex_and_continue; 451 //goto _release_tex_and_continue;
452 stru_506E40.Release(); 452 stru_506E40.Release();
453 continue; 453 continue;
454 case 0x80: 454 case UIMSG_80:
455 pIcons_LOD->_40F9C5(); 455 pIcons_LOD->_40F9C5();
456 pIcons_LOD->_4114F2(); 456 pIcons_LOD->_4114F2();
457 pGUIWindow_CurrentMenu->Release(); 457 pGUIWindow_CurrentMenu->Release();
458 pCurrentScreen = 2; 458 pCurrentScreen = SCREEN_OPTIONS;
459 v162 = 0; 459 v162 = 0;
460 v148 = 0; 460 v148 = 0;
461 pWindowType = (WindowType)8; 461 pWindowType = (WindowType)8;
462 //goto LABEL_439; 462 //goto LABEL_439;
463 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162); 463 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162);
515 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 515 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
516 continue; 516 continue;
517 case UIMSG_SelectLoadSlot: 517 case UIMSG_SelectLoadSlot:
518 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 518 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
519 pKeyActionMap->_459ED1(0); 519 pKeyActionMap->_459ED1(0);
520 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) 520 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
521 { 521 {
522 v10 = pSaveListPosition + uMessageParam; 522 v10 = pSaveListPosition + uMessageParam;
523 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) 523 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
524 { 524 {
525 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 525 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
570 } 570 }
571 DoSavegame(uLoadGameUI_SelectedSlot); 571 DoSavegame(uLoadGameUI_SelectedSlot);
572 //goto _release_tex_and_continue; 572 //goto _release_tex_and_continue;
573 stru_506E40.Release(); 573 stru_506E40.Release();
574 continue; 574 continue;
575 case UIMSG_StartNewGame|0x2: 575 case UIMSG_Game_OpenSaveGameDialog:
576 pGUIWindow_CurrentMenu->Release(); 576 pGUIWindow_CurrentMenu->Release();
577 pCurrentScreen = 11; 577 pCurrentScreen = SCREEN_SAVEGAME;
578 GameUI_DrawSaveMenu(); 578 GameUI_DrawSaveMenu();
579 continue; 579 continue;
580 case UIMSG_Game_OpenOptionsDialog: 580 case UIMSG_Game_OpenOptionsDialog:
581 if ( pMessageQueue_50CBD0->uNumMessages ) 581 if ( pMessageQueue_50CBD0->uNumMessages )
582 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 582 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
583 pGUIWindow_CurrentMenu->Release(); 583 pGUIWindow_CurrentMenu->Release();
584 viewparams->field_48 = v0; 584 viewparams->field_48 = v0;
585 pCurrentScreen = 2; 585 pCurrentScreen = SCREEN_OPTIONS;
586 uTextureID_507C60 = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); 586 uTextureID_507C60 = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
587 uTextureID_507C6C = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); 587 uTextureID_507C6C = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
588 uTextureID_507C68 = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); 588 uTextureID_507C68 = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
589 uTextureID_507C70 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); 589 uTextureID_507C70 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
590 uTextureID_507C74 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); 590 uTextureID_507C74 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
668 case UIMSG_OpenKeyMappingOptions: 668 case UIMSG_OpenKeyMappingOptions:
669 if ( pMessageQueue_50CBD0->uNumMessages ) 669 if ( pMessageQueue_50CBD0->uNumMessages )
670 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 670 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
671 pGUIWindow_CurrentMenu->Release(); 671 pGUIWindow_CurrentMenu->Release();
672 viewparams->field_48 = 1; 672 viewparams->field_48 = 1;
673 pCurrentScreen = 26; 673 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
674 uTextureID_507BF4 = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); 674 uTextureID_507BF4 = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
675 uTextureID_507BF8 = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); 675 uTextureID_507BF8 = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
676 uTextureID_507BFC = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); 676 uTextureID_507BFC = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
677 uTextureID_507C00 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); 677 uTextureID_507C00 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
678 uTextureID_507C04 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); 678 uTextureID_507C04 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
705 v1 = ""; 705 v1 = "";
706 v0 = 1; 706 v0 = 1;
707 continue; 707 continue;
708 //default: 708 //default:
709 //continue; 709 //continue;
710 case UIMSG_ResetKeyMapping|0x1: 710 case UIMSG_1A3:
711 if ( dword_506E68 != -1 ) 711 if ( dword_506E68 != -1 )
712 goto LABEL_623; 712 goto LABEL_623;
713 v14 = uMessageParam; 713 v14 = uMessageParam;
714 if ( dword_506F08 != v0 ) 714 if ( dword_506F08 != v0 )
715 v14 = uMessageParam + 14; 715 v14 = uMessageParam + 14;
754 v127 = 219; 754 v127 = 219;
755 goto _play_sound_and_continue; 755 goto _play_sound_and_continue;
756 case 0x1A0: 756 case 0x1A0:
757 dword_506F08 = v0; 757 dword_506F08 = v0;
758 continue; 758 continue;
759 case UIMSG_StartNPCDialogue|0x100: 759 case UIMSG_1A1:
760 dword_506F08 = 2; 760 dword_506F08 = 2;
761 continue; 761 continue;
762 case UIMSG_OpenVideoOptions: 762 case UIMSG_OpenVideoOptions:
763 if ( pMessageQueue_50CBD0->uNumMessages ) 763 if ( pMessageQueue_50CBD0->uNumMessages )
764 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 764 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
765 pGUIWindow_CurrentMenu->Release(); 765 pGUIWindow_CurrentMenu->Release();
766 viewparams->field_48 = v0; 766 viewparams->field_48 = v0;
767 pCurrentScreen = 28; 767 pCurrentScreen = SCREEN_VIDEO_OPTIONS;
768 uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); 768 uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
769 uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); 769 uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
770 uTextureID_507C18 = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); 770 uTextureID_507C18 = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
771 uTextureID_507C1C = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); 771 uTextureID_507C1C = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE);
772 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); 772 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
815 //LABEL_117: 815 //LABEL_117:
816 pGUIWindow_CurrentMenu->CreateButton(v120, v122, v124, v126, v129, v131, v134, v138, v143, v150, pTexture); 816 pGUIWindow_CurrentMenu->CreateButton(v120, v122, v124, v126, v129, v131, v134, v138, v143, v150, pTexture);
817 } 817 }
818 } 818 }
819 continue; 819 continue;
820 case UIMSG_ToggleTint|0x1: 820 case UIMSG_1A9:
821 if ( uMessageParam == 4 ) 821 if ( uMessageParam == 4 )
822 { 822 {
823 --uGammaPos; 823 //--uGammaPos;
824 if ( (uGammaPos & 0x80000000u) != 0 ) 824 if ( (uGammaPos -- -1) < 0 )
825 { 825 {
826 uGammaPos = 0; 826 uGammaPos = 0;
827 //goto LABEL_128; 827 //goto LABEL_128;
828 v165 = 0; 828 v165 = 0;
829 v151 = 0; 829 v151 = 0;
1115 MM7Initialization(); 1115 MM7Initialization();
1116 continue; 1116 continue;
1117 } 1117 }
1118 ModalWindow(pNPCTopics[453].pText, 0); 1118 ModalWindow(pNPCTopics[453].pText, 0);
1119 continue; 1119 continue;
1120 case UIMSG_SkillUp|0x2: 1120 case UIMSG_7B:
1121 pGUIWindow_CurrentMenu->Release(); 1121 pGUIWindow_CurrentMenu->Release();
1122 pEventTimer->Resume(); 1122 pEventTimer->Resume();
1123 goto LABEL_188; 1123 goto LABEL_188;
1124 case UIMSG_OpenQuestBook: 1124 case UIMSG_OpenQuestBook:
1125 if ( pMessageQueue_50CBD0->uNumMessages ) 1125 if ( pMessageQueue_50CBD0->uNumMessages )
1190 continue; 1190 continue;
1191 case UIMSG_Escape:// нажатие Escape 1191 case UIMSG_Escape:// нажатие Escape
1192 back_to_game(); 1192 back_to_game();
1193 if ( pMessageQueue_50CBD0->uNumMessages ) 1193 if ( pMessageQueue_50CBD0->uNumMessages )
1194 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1194 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1195 if ( pCurrentScreen > 15 ) 1195 if ( pCurrentScreen > SCREEN_F )
1196 { 1196 {
1197 if ( pCurrentScreen >= 17 && (pCurrentScreen <= 18 || pCurrentScreen == 104) ) 1197 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) )
1198 { 1198 {
1199 //LABEL_229: 1199 //LABEL_229:
1200 if ( dword_50CDC8 ) 1200 if ( dword_50CDC8 )
1201 goto LABEL_232; 1201 goto LABEL_232;
1202 CloseWindowBackground(); 1202 CloseWindowBackground();
1205 goto LABEL_232; 1205 goto LABEL_232;
1206 } 1206 }
1207 } 1207 }
1208 else 1208 else
1209 { 1209 {
1210 if ( pCurrentScreen >= 14 || pCurrentScreen == 4 || pCurrentScreen == 10 ) 1210 if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST )
1211 { 1211 {
1212 //goto LABEL_229; 1212 //goto LABEL_229;
1213 if ( dword_50CDC8 ) 1213 if ( dword_50CDC8 )
1214 goto LABEL_232; 1214 goto LABEL_232;
1215 CloseWindowBackground(); 1215 CloseWindowBackground();
1216 //goto LABEL_231; 1216 //goto LABEL_231;
1217 uMessageParam = v0; 1217 uMessageParam = v0;
1218 goto LABEL_232; 1218 goto LABEL_232;
1219 } 1219 }
1220 if ( pCurrentScreen == 13 && !dword_50CDC8 && !dword_5C35C8 ) 1220 if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 )
1221 { 1221 {
1222 CloseWindowBackground(); 1222 CloseWindowBackground();
1223 dword_5C35C8 = 0; 1223 dword_5C35C8 = 0;
1224 //LABEL_231: 1224 //LABEL_231:
1225 uMessageParam = v0; 1225 uMessageParam = v0;
1232 pRenderer->ClearZBuffer(0, 479); 1232 pRenderer->ClearZBuffer(0, 479);
1233 viewparams->bRedrawGameUI = v0; 1233 viewparams->bRedrawGameUI = v0;
1234 viewparams->field_48 = v0; 1234 viewparams->field_48 = v0;
1235 if ( pCurrentScreen ) 1235 if ( pCurrentScreen )
1236 { 1236 {
1237 if ( pCurrentScreen > 103 ) 1237 if ( pCurrentScreen > SCREEN_67 )
1238 { 1238 {
1239 if ( pCurrentScreen == 104 ) 1239 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
1240 goto LABEL_321; 1240 goto LABEL_321;
1241 } 1241 }
1242 else 1242 else
1243 { 1243 {
1244 if ( pCurrentScreen < 100 ) 1244 if ( pCurrentScreen < SCREEN_64 )
1245 { 1245 {
1246 switch ( pCurrentScreen ) 1246 switch ( pCurrentScreen )
1247 { 1247 {
1248 case 23: 1248 case SCREEN_CASTING:
1249 pIcons_LOD->_4114F2(); 1249 pIcons_LOD->_4114F2();
1250 if ( some_active_character ) 1250 if ( some_active_character )
1251 { 1251 {
1252 uActiveCharacter = some_active_character; 1252 uActiveCharacter = some_active_character;
1253 uActiveCharacter = pParty->GetNextActiveCharacter(); 1253 uActiveCharacter = pParty->GetNextActiveCharacter();
1265 ptr_50C9A4 = 0; 1265 ptr_50C9A4 = 0;
1266 } 1266 }
1267 //goto LABEL_322; 1267 //goto LABEL_322;
1268 if ( pGUIWindow_Settings ) 1268 if ( pGUIWindow_Settings )
1269 { 1269 {
1270 if ( pCurrentScreen == 7 ) 1270 if ( pCurrentScreen == SCREEN_CHARACTERS )
1271 { 1271 {
1272 pMouse->SetCursorBitmap("MICON2"); 1272 pMouse->SetCursorBitmap("MICON2");
1273 } 1273 }
1274 else 1274 else
1275 { 1275 {
1286 pGUIWindow_CurrentMenu->Release(); 1286 pGUIWindow_CurrentMenu->Release();
1287 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1287 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1288 ptr_507BC0 = 0; 1288 ptr_507BC0 = 0;
1289 pGUIWindow_CurrentMenu = 0; 1289 pGUIWindow_CurrentMenu = 0;
1290 pEventTimer->Resume(); 1290 pEventTimer->Resume();
1291 pCurrentScreen = 0; 1291 pCurrentScreen = SCREEN_GAME;
1292 viewparams->bRedrawGameUI = v0; 1292 viewparams->bRedrawGameUI = v0;
1293 pIcons_LOD->_4355F7(); 1293 pIcons_LOD->_4355F7();
1294 continue; 1294 continue;
1295 case 3: 1295 case SCREEN_BOOKS:
1296 pBooksWindow->Release(); 1296 pBooksWindow->Release();
1297 //crt_deconstruct_ptr_6A0118(); 1297 //crt_deconstruct_ptr_6A0118();
1298 pBooksWindow = 0; 1298 pBooksWindow = 0;
1299 pEventTimer->Resume(); 1299 pEventTimer->Resume();
1300 //goto LABEL_322; 1300 //goto LABEL_322;
1301 if ( pGUIWindow_Settings ) 1301 if ( pGUIWindow_Settings )
1302 { 1302 {
1303 if ( pCurrentScreen == 7 ) 1303 if ( pCurrentScreen == SCREEN_CHARACTERS )
1304 { 1304 {
1305 pMouse->SetCursorBitmap("MICON2"); 1305 pMouse->SetCursorBitmap("MICON2");
1306 } 1306 }
1307 else 1307 else
1308 { 1308 {
1319 pGUIWindow_CurrentMenu->Release(); 1319 pGUIWindow_CurrentMenu->Release();
1320 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1320 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1321 ptr_507BC0 = 0; 1321 ptr_507BC0 = 0;
1322 pGUIWindow_CurrentMenu = 0; 1322 pGUIWindow_CurrentMenu = 0;
1323 pEventTimer->Resume(); 1323 pEventTimer->Resume();
1324 pCurrentScreen = 0; 1324 pCurrentScreen = SCREEN_GAME;
1325 viewparams->bRedrawGameUI = v0; 1325 viewparams->bRedrawGameUI = v0;
1326 pIcons_LOD->_4355F7(); 1326 pIcons_LOD->_4355F7();
1327 continue; 1327 continue;
1328 case 11: 1328 case SCREEN_SAVEGAME:
1329 case 12: 1329 case SCREEN_LOADGAME:
1330 pIcons_LOD->_4114F2(); 1330 pIcons_LOD->_4114F2();
1331 //crt_deconstruct_ptr_6A0118(); 1331 //crt_deconstruct_ptr_6A0118();
1332 //goto LABEL_291; 1332 //goto LABEL_291;
1333 stru_506E40.Release(); 1333 stru_506E40.Release();
1334 break; 1334 break;
1335 case 15: 1335 case SCREEN_F:
1336 pCurrentScreen = 10; 1336 pCurrentScreen = SCREEN_CHEST;
1337 continue; 1337 continue;
1338 case 10: 1338 case SCREEN_CHEST:
1339 pWindow2 = pChestWindow; 1339 pWindow2 = pChestWindow;
1340 //goto LABEL_249; 1340 //goto LABEL_249;
1341 pWindow2->Release(); 1341 pWindow2->Release();
1342 pIcons_LOD->_4114F2(); 1342 pIcons_LOD->_4114F2();
1343 pCurrentScreen = 0; 1343 pCurrentScreen = SCREEN_GAME;
1344 viewparams->bRedrawGameUI = v0; 1344 viewparams->bRedrawGameUI = v0;
1345 pEventTimer->Resume(); 1345 pEventTimer->Resume();
1346 continue; 1346 continue;
1347 case 25: 1347 case SCREEN_19:
1348 pWindow2 = ptr_507BC8; 1348 pWindow2 = ptr_507BC8;
1349 //LABEL_249: 1349 //LABEL_249:
1350 pWindow2->Release(); 1350 pWindow2->Release();
1351 pIcons_LOD->_4114F2(); 1351 pIcons_LOD->_4114F2();
1352 pCurrentScreen = 0; 1352 pCurrentScreen = SCREEN_GAME;
1353 viewparams->bRedrawGameUI = v0; 1353 viewparams->bRedrawGameUI = v0;
1354 pEventTimer->Resume(); 1354 pEventTimer->Resume();
1355 continue; 1355 continue;
1356 case 2: 1356 case SCREEN_OPTIONS:
1357 thisa = (signed int)&uTextureID_507C60; 1357 thisa = (signed int)&uTextureID_507C60;
1358 do 1358 do
1359 { 1359 {
1360 if ( *(int *)thisa ) 1360 if ( *(int *)thisa )
1361 pIcons_LOD->pTextures[*(int *)thisa].Release(); 1361 pIcons_LOD->pTextures[*(int *)thisa].Release();
1406 //LABEL_263: 1406 //LABEL_263:
1407 WriteWindowsRegistryInt(v31, v30); 1407 WriteWindowsRegistryInt(v31, v30);
1408 //LABEL_291: 1408 //LABEL_291:
1409 stru_506E40.Release(); 1409 stru_506E40.Release();
1410 break; 1410 break;
1411 case 1: 1411 case SCREEN_MENU:
1412 pIcons_LOD->_40F9C5(); 1412 pIcons_LOD->_40F9C5();
1413 pIcons_LOD->_4114F2(); 1413 pIcons_LOD->_4114F2();
1414 pIcons_LOD->_40F9C5(); 1414 pIcons_LOD->_40F9C5();
1415 pIcons_LOD->_4114F2(); 1415 pIcons_LOD->_4114F2();
1416 //goto LABEL_291; 1416 //goto LABEL_291;
1417 stru_506E40.Release(); 1417 stru_506E40.Release();
1418 break; 1418 break;
1419 case 28: 1419 case SCREEN_VIDEO_OPTIONS:
1420 if ( pRenderer->pRenderD3D ) 1420 if ( pRenderer->pRenderD3D )
1421 { 1421 {
1422 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights); 1422 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
1423 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting); 1423 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
1424 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1); 1424 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1);
1433 v31 = "GammaPos"; 1433 v31 = "GammaPos";
1434 //goto LABEL_263; 1434 //goto LABEL_263;
1435 WriteWindowsRegistryInt(v31, v30); 1435 WriteWindowsRegistryInt(v31, v30);
1436 stru_506E40.Release(); 1436 stru_506E40.Release();
1437 break; 1437 break;
1438 case 26: 1438 case SCREEN_KEYBOARD_OPTIONS:
1439 v197 = 1; 1439 v197 = 1;
1440 v32 = 0; 1440 v32 = 0;
1441 while ( *((char *)word_506E6C + v32) != 1 ) 1441 while ( *((char *)word_506E6C + v32) != 1 )
1442 { 1442 {
1443 ++v32; 1443 ++v32;
1484 stru_506E40.Release(); 1484 stru_506E40.Release();
1485 break; 1485 break;
1486 } 1486 }
1487 } 1487 }
1488 goto LABEL_623; 1488 goto LABEL_623;
1489 case 5: 1489 case SCREEN_REST:
1490 if ( dword_506F14 ) 1490 if ( dword_506F14 )
1491 { 1491 {
1492 Rest(_506F18_num_hours_to_sleep); 1492 Rest(_506F18_num_hours_to_sleep);
1493 pParty->pPlayers[3].pConditions[2] = 0i64; 1493 pParty->pPlayers[3].pConditions[2] = 0i64;
1494 pParty->pPlayers[2].pConditions[2] = 0i64; 1494 pParty->pPlayers[2].pConditions[2] = 0i64;
1505 dword_506F14 = 0; 1505 dword_506F14 = 0;
1506 dword_507B94 = v0; 1506 dword_507B94 = v0;
1507 //goto LABEL_322; 1507 //goto LABEL_322;
1508 if ( pGUIWindow_Settings ) 1508 if ( pGUIWindow_Settings )
1509 { 1509 {
1510 if ( pCurrentScreen == 7 ) 1510 if ( pCurrentScreen == SCREEN_CHARACTERS )
1511 { 1511 {
1512 pMouse->SetCursorBitmap("MICON2"); 1512 pMouse->SetCursorBitmap("MICON2");
1513 } 1513 }
1514 else 1514 else
1515 { 1515 {
1526 pGUIWindow_CurrentMenu->Release(); 1526 pGUIWindow_CurrentMenu->Release();
1527 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1527 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1528 ptr_507BC0 = 0; 1528 ptr_507BC0 = 0;
1529 pGUIWindow_CurrentMenu = 0; 1529 pGUIWindow_CurrentMenu = 0;
1530 pEventTimer->Resume(); 1530 pEventTimer->Resume();
1531 pCurrentScreen = 0; 1531 pCurrentScreen = SCREEN_GAME;
1532 viewparams->bRedrawGameUI = v0; 1532 viewparams->bRedrawGameUI = v0;
1533 pIcons_LOD->_4355F7(); 1533 pIcons_LOD->_4355F7();
1534 continue; 1534 continue;
1535 case 14: 1535 case SCREEN_E:
1536 pGUIWindow_CurrentMenu->Release(); 1536 pGUIWindow_CurrentMenu->Release();
1537 pCurrentScreen = 13; 1537 pCurrentScreen = SCREEN_HOUSE;
1538 pIcons_LOD->_4114F2(); 1538 pIcons_LOD->_4114F2();
1539 continue; 1539 continue;
1540 case 13: 1540 case SCREEN_HOUSE:
1541 if ( uDialogueType ) 1541 if ( uDialogueType )
1542 uDialogueType = 0; 1542 uDialogueType = 0;
1543 if ( uGameState == 2 ) 1543 if ( uGameState == 2 )
1544 { 1544 {
1545 while ( sub_4BD8B5() ) 1545 while ( sub_4BD8B5() )
1555 pVideoPlayer->Unload(); 1555 pVideoPlayer->Unload();
1556 pGUIWindow_CurrentMenu = ptr_507BC0; 1556 pGUIWindow_CurrentMenu = ptr_507BC0;
1557 //goto LABEL_322; 1557 //goto LABEL_322;
1558 if ( pGUIWindow_Settings ) 1558 if ( pGUIWindow_Settings )
1559 { 1559 {
1560 if ( pCurrentScreen == 7 ) 1560 if ( pCurrentScreen == SCREEN_CHARACTERS )
1561 { 1561 {
1562 pMouse->SetCursorBitmap("MICON2"); 1562 pMouse->SetCursorBitmap("MICON2");
1563 } 1563 }
1564 else 1564 else
1565 { 1565 {
1576 pGUIWindow_CurrentMenu->Release(); 1576 pGUIWindow_CurrentMenu->Release();
1577 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1577 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1578 ptr_507BC0 = 0; 1578 ptr_507BC0 = 0;
1579 pGUIWindow_CurrentMenu = 0; 1579 pGUIWindow_CurrentMenu = 0;
1580 pEventTimer->Resume(); 1580 pEventTimer->Resume();
1581 pCurrentScreen = 0; 1581 pCurrentScreen = SCREEN_GAME;
1582 viewparams->bRedrawGameUI = v0; 1582 viewparams->bRedrawGameUI = v0;
1583 pIcons_LOD->_4355F7(); 1583 pIcons_LOD->_4355F7();
1584 continue; 1584 continue;
1585 case 18: 1585 case SCREEN_INPUT_BLV:
1586 if ( uCurrentHouse_Animation == 153 ) 1586 if ( uCurrentHouse_Animation == 153 )
1587 HousePlaySomeSound(0x99u, 3); 1587 HousePlaySomeSound(0x99u, 3);
1588 pVideoPlayer->Unload(); 1588 pVideoPlayer->Unload();
1589 //goto LABEL_306; 1589 //goto LABEL_306;
1590 if ( dword_5B65CC ) 1590 if ( dword_5B65CC )
1594 sub_44A56A(); 1594 sub_44A56A();
1595 viewparams->bRedrawGameUI = v0; 1595 viewparams->bRedrawGameUI = v0;
1596 dword_5B65CC = 0; 1596 dword_5B65CC = 0;
1597 } 1597 }
1598 goto LABEL_317; 1598 goto LABEL_317;
1599 case 4: 1599 case SCREEN_NPC_DIALOGUE:
1600 //LABEL_306: 1600 //LABEL_306:
1601 if ( dword_5B65CC ) 1601 if ( dword_5B65CC )
1602 { 1602 {
1603 pParty->field_709 = 0; 1603 pParty->field_709 = 0;
1604 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; 1604 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
1605 sub_44A56A(); 1605 sub_44A56A();
1606 viewparams->bRedrawGameUI = v0; 1606 viewparams->bRedrawGameUI = v0;
1607 dword_5B65CC = 0; 1607 dword_5B65CC = 0;
1608 } 1608 }
1609 goto LABEL_317; 1609 goto LABEL_317;
1610 case 19: 1610 case SCREEN_BRANCHLESS_NPC_DIALOG:
1611 memset(GameUI_StatusBar_TimedString, 0, 0xC8u); 1611 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
1612 sub_4452BB(); 1612 sub_4452BB();
1613 goto LABEL_317; 1613 goto LABEL_317;
1614 case 17: 1614 case SCREEN_CHANGE_LOCATION:
1615 if ( pParty->vPosition.x < -22528 ) 1615 if ( pParty->vPosition.x < -22528 )
1616 pParty->vPosition.x = -22528; 1616 pParty->vPosition.x = -22528;
1617 if ( pParty->vPosition.x > 22528 ) 1617 if ( pParty->vPosition.x > 22528 )
1618 pParty->vPosition.x = 22528; 1618 pParty->vPosition.x = 22528;
1619 if ( pParty->vPosition.y < -22528 ) 1619 if ( pParty->vPosition.y < -22528 )
1620 pParty->vPosition.y = -22528; 1620 pParty->vPosition.y = -22528;
1621 if ( pParty->vPosition.y > 22528 ) 1621 if ( pParty->vPosition.y > 22528 )
1622 pParty->vPosition.y = 22528; 1622 pParty->vPosition.y = 22528;
1623 goto LABEL_317; 1623 goto LABEL_317;
1624 case 16: 1624 case SCREEN_VIDEO:
1625 pVideoPlayer->Unload(); 1625 pVideoPlayer->Unload();
1626 continue; 1626 continue;
1627 case 7: 1627 case SCREEN_CHARACTERS:
1628 goto LABEL_319; 1628 goto LABEL_319;
1629 default: 1629 default:
1630 //goto LABEL_322; 1630 //goto LABEL_322;
1631 if ( pGUIWindow_Settings ) 1631 if ( pGUIWindow_Settings )
1632 { 1632 {
1633 if ( pCurrentScreen == 7 ) 1633 if ( pCurrentScreen == SCREEN_CHARACTERS )
1634 { 1634 {
1635 pMouse->SetCursorBitmap("MICON2"); 1635 pMouse->SetCursorBitmap("MICON2");
1636 } 1636 }
1637 else 1637 else
1638 { 1638 {
1649 pGUIWindow_CurrentMenu->Release(); 1649 pGUIWindow_CurrentMenu->Release();
1650 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1650 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1651 ptr_507BC0 = 0; 1651 ptr_507BC0 = 0;
1652 pGUIWindow_CurrentMenu = 0; 1652 pGUIWindow_CurrentMenu = 0;
1653 pEventTimer->Resume(); 1653 pEventTimer->Resume();
1654 pCurrentScreen = 0; 1654 pCurrentScreen = SCREEN_GAME;
1655 viewparams->bRedrawGameUI = v0; 1655 viewparams->bRedrawGameUI = v0;
1656 pIcons_LOD->_4355F7(); 1656 pIcons_LOD->_4355F7();
1657 continue; 1657 continue;
1658 } 1658 }
1659 //goto LABEL_322; 1659 //goto LABEL_322;
1660 if ( pGUIWindow_Settings ) 1660 if ( pGUIWindow_Settings )
1661 { 1661 {
1662 if ( pCurrentScreen == 7 ) 1662 if ( pCurrentScreen == SCREEN_CHARACTERS )
1663 { 1663 {
1664 pMouse->SetCursorBitmap("MICON2"); 1664 pMouse->SetCursorBitmap("MICON2");
1665 } 1665 }
1666 else 1666 else
1667 { 1667 {
1678 pGUIWindow_CurrentMenu->Release(); 1678 pGUIWindow_CurrentMenu->Release();
1679 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1679 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1680 ptr_507BC0 = 0; 1680 ptr_507BC0 = 0;
1681 pGUIWindow_CurrentMenu = 0; 1681 pGUIWindow_CurrentMenu = 0;
1682 pEventTimer->Resume(); 1682 pEventTimer->Resume();
1683 pCurrentScreen = 0; 1683 pCurrentScreen = SCREEN_GAME;
1684 viewparams->bRedrawGameUI = v0; 1684 viewparams->bRedrawGameUI = v0;
1685 pIcons_LOD->_4355F7(); 1685 pIcons_LOD->_4355F7();
1686 continue; 1686 continue;
1687 } 1687 }
1688 LABEL_319: 1688 LABEL_319:
1692 pIcons_LOD->_4114F2(); 1692 pIcons_LOD->_4114F2();
1693 } 1693 }
1694 //LABEL_322: 1694 //LABEL_322:
1695 if ( pGUIWindow_Settings ) 1695 if ( pGUIWindow_Settings )
1696 { 1696 {
1697 if ( pCurrentScreen == 7 ) 1697 if ( pCurrentScreen == SCREEN_CHARACTERS )
1698 { 1698 {
1699 pMouse->SetCursorBitmap("MICON2"); 1699 pMouse->SetCursorBitmap("MICON2");
1700 } 1700 }
1701 else 1701 else
1702 { 1702 {
1713 pGUIWindow_CurrentMenu->Release(); 1713 pGUIWindow_CurrentMenu->Release();
1714 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1714 if ( pGUIWindow_CurrentMenu == ptr_507BC0 )
1715 ptr_507BC0 = 0; 1715 ptr_507BC0 = 0;
1716 pGUIWindow_CurrentMenu = 0; 1716 pGUIWindow_CurrentMenu = 0;
1717 pEventTimer->Resume(); 1717 pEventTimer->Resume();
1718 pCurrentScreen = 0; 1718 pCurrentScreen = SCREEN_GAME;
1719 viewparams->bRedrawGameUI = v0; 1719 viewparams->bRedrawGameUI = v0;
1720 pIcons_LOD->_4355F7(); 1720 pIcons_LOD->_4355F7();
1721 continue; 1721 continue;
1722 } 1722 }
1723 pWindow3 = pGUIWindow_Settings; 1723 pWindow3 = pGUIWindow_Settings;
1799 pParty->field_709 = 0; 1799 pParty->field_709 = 0;
1800 } 1800 }
1801 } 1801 }
1802 DrawHiredNPCs(); 1802 DrawHiredNPCs();
1803 continue; 1803 continue;
1804 case UIMSG_OpenRestUI|0x2: 1804 case UIMSG_19B:
1805 if ( pMessageQueue_50CBD0->uNumMessages ) 1805 if ( pMessageQueue_50CBD0->uNumMessages )
1806 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1806 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1807 dword_50CDC8 = v0; 1807 dword_50CDC8 = v0;
1808 sub_42FBDD(); 1808 sub_42FBDD();
1809 HousePlaySomeSound(uCurrentHouse_Animation, 2); 1809 HousePlaySomeSound(uCurrentHouse_Animation, 2);
1860 } 1860 }
1861 dword_597F18 = 0; 1861 dword_597F18 = 0;
1862 if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) 1862 if ( !_strcmpi(byte_6BE3B0, "d05.blv") )
1863 pParty->uTimePlayed += 1474560i64; 1863 pParty->uTimePlayed += 1474560i64;
1864 continue; 1864 continue;
1865 case 0x19C: 1865 case UIMSG_19C:
1866 CloseWindowBackground(); 1866 CloseWindowBackground();
1867 pVideoPlayer->Unload(); 1867 pVideoPlayer->Unload();
1868 sub_44603D(); 1868 sub_44603D();
1869 dword_597F18 = 0; 1869 dword_597F18 = 0;
1870 goto LABEL_422; 1870 goto LABEL_422;
1871 case UIMSG_CycleCharacters: 1871 case UIMSG_CycleCharacters:
1872 v39 = GetAsyncKeyState(VK_SHIFT); 1872 v39 = GetAsyncKeyState(VK_SHIFT);
1873 v40 = CycleCharacter(v39); 1873 v40 = CycleCharacter(v39);
1874 goto LABEL_421; 1874 goto LABEL_421;
1875 case UIMSG_LoadGame|0x8: 1875 case UIMSG_5A:
1876 if ( pMessageQueue_50CBD0->uNumMessages ) 1876 if ( pMessageQueue_50CBD0->uNumMessages )
1877 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1877 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1878 dword_50CDC8 = v0; 1878 dword_50CDC8 = v0;
1879 sub_42FBDD(); 1879 sub_42FBDD();
1880 pNPCData4 = (NPCData *)GetTravelTime(); 1880 pNPCData4 = (NPCData *)GetTravelTime();
1893 pParty->vPosition.y = -22528; 1893 pParty->vPosition.y = -22528;
1894 if ( pParty->vPosition.y > 22528 ) 1894 if ( pParty->vPosition.y > 22528 )
1895 pParty->vPosition.y = 22528; 1895 pParty->vPosition.y = 22528;
1896 LABEL_317: 1896 LABEL_317:
1897 sub_44603D(); 1897 sub_44603D();
1898 pCurrentScreen = 0; 1898 pCurrentScreen = SCREEN_GAME;
1899 } 1899 }
1900 else 1900 else
1901 { 1901 {
1902 pParty->field_6E4 = 0; 1902 pParty->field_6E4 = 0;
1903 pParty->field_6E0 = 0; 1903 pParty->field_6E0 = 0;
1966 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, (int *)&v213, 0); 1966 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, (int *)&v213, 0);
1967 pParty->uFallStartY = pParty->vPosition.z; 1967 pParty->uFallStartY = pParty->vPosition.z;
1968 sub_461103(); 1968 sub_461103();
1969 pEventTimer->Resume(); 1969 pEventTimer->Resume();
1970 viewparams->bRedrawGameUI = 1; 1970 viewparams->bRedrawGameUI = 1;
1971 pCurrentScreen = 0; 1971 pCurrentScreen = SCREEN_GAME;
1972 pGameLoadingUI_ProgressBar->Release(); 1972 pGameLoadingUI_ProgressBar->Release();
1973 } 1973 }
1974 goto LABEL_422; 1974 goto LABEL_422;
1975 case UIMSG_SaveGame|0x8: 1975 case UIMSG_5B:
1976 goto LABEL_387; 1976 goto LABEL_387;
1977 case UIMSG_BE: 1977 case UIMSG_BE:
1978 if ( pRenderer->pRenderD3D ) 1978 if ( pRenderer->pRenderD3D )
1979 { 1979 {
1980 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); 1980 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val();
2081 pMouse->SetCursorBitmap("MICON1"); 2081 pMouse->SetCursorBitmap("MICON1");
2082 GameUI_StatusBar_TimedStringTimeLeft = 0; 2082 GameUI_StatusBar_TimedStringTimeLeft = 0;
2083 unk_50C9A0 = 0; 2083 unk_50C9A0 = 0;
2084 back_to_game(); 2084 back_to_game();
2085 continue; 2085 continue;
2086 case UIMSG_ChangeGameState|0x40: 2086 case UIMSG_45:
2087 case 0x8D: 2087 case UIMSG_8D:
2088 case 0x8F: 2088 case UIMSG_8F:
2089 if ( pMessageQueue_50CBD0->uNumMessages ) 2089 if ( pMessageQueue_50CBD0->uNumMessages )
2090 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 2090 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2091 if ( unk_50C9A0 ) 2091 if ( unk_50C9A0 )
2092 { 2092 {
2093 v40 = uMessageParam; 2093 v40 = uMessageParam;
2504 continue; 2504 continue;
2505 case UIMSG_C4: 2505 case UIMSG_C4:
2506 uGameState = 0; 2506 uGameState = 0;
2507 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); 2507 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
2508 goto LABEL_524; 2508 goto LABEL_524;
2509 case UIMSG_D5|0x8: 2509 case UIMSG_DD:
2510 LABEL_524: 2510 LABEL_524:
2511 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); 2511 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer);
2512 memcpy(&v216, texture_frame_table_txt_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); 2512 memcpy(&v216, texture_frame_table_txt_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
2513 if ( v216.field_0 == 1 ) 2513 if ( v216.field_0 == 1 )
2514 { 2514 {
2611 ShowStatusBarString(v73, 6u); 2611 ShowStatusBarString(v73, 6u);
2612 //goto LABEL_90; 2612 //goto LABEL_90;
2613 v1 = ""; 2613 v1 = "";
2614 v0 = 1; 2614 v0 = 1;
2615 continue; 2615 continue;
2616 case 0x19: 2616 case UIMSG_19:
2617 if ( bUnderwater == 1 ) 2617 if ( bUnderwater == 1 )
2618 goto LABEL_682; 2618 goto LABEL_682;
2619 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) 2619 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
2620 //goto LABEL_90; 2620 //goto LABEL_90;
2621 { 2621 {
2629 v147 = 0; 2629 v147 = 0;
2630 v80 = uActiveCharacter - 1; 2630 v80 = uActiveCharacter - 1;
2631 //goto LABEL_679; 2631 //goto LABEL_679;
2632 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175); 2632 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
2633 continue; 2633 continue;
2634 case 0x46: 2634 case UIMSG_46:
2635 case UIMSG_Quit|0x8: 2635 case UIMSG_8C:
2636 if ( pRenderer->pRenderD3D ) 2636 if ( pRenderer->pRenderD3D )
2637 { 2637 {
2638 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); 2638 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
2639 } 2639 }
2640 else 2640 else
2675 pMouse->SetCursorBitmap("MICON1"); 2675 pMouse->SetCursorBitmap("MICON1");
2676 GameUI_StatusBar_TimedStringTimeLeft = 0; 2676 GameUI_StatusBar_TimedStringTimeLeft = 0;
2677 unk_50C9A0 = 0; 2677 unk_50C9A0 = 0;
2678 back_to_game(); 2678 back_to_game();
2679 continue; 2679 continue;
2680 case 0x1C: 2680 case UIMSG_1C:
2681 if ( !uActiveCharacter || pCurrentScreen ) 2681 if ( !uActiveCharacter || pCurrentScreen )
2682 //goto LABEL_90; 2682 //goto LABEL_90;
2683 { 2683 {
2684 v1 = ""; 2684 v1 = "";
2685 v0 = 1; 2685 v0 = 1;
2686 continue; 2686 continue;
2687 } 2687 }
2688 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)104, uMessageParam, 0); 2688 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)104, uMessageParam, 0);
2689 pCurrentScreen = 25; 2689 pCurrentScreen = SCREEN_19;
2690 pEventTimer->Pause(); 2690 pEventTimer->Pause();
2691 continue; 2691 continue;
2692 case 0x1B: 2692 case UIMSG_1B:
2693 if ( !uActiveCharacter ) 2693 if ( !uActiveCharacter )
2694 //goto LABEL_90; 2694 //goto LABEL_90;
2695 { 2695 {
2696 v1 = ""; 2696 v1 = "";
2697 v0 = 1; 2697 v0 = 1;
2745 } 2745 }
2746 if ( !(pTurnEngine->field_18 & 2) ) 2746 if ( !(pTurnEngine->field_18 & 2) )
2747 //LABEL_577: 2747 //LABEL_577:
2748 _42ECB5_PlayerAttacksActor(); 2748 _42ECB5_PlayerAttacksActor();
2749 continue; 2749 continue;
2750 case UIMSG_A7: 2750 case UIMSG_ExitRest:
2751 v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest" 2751 v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest"
2752 pButton = pButton_RestUI_Exit; 2752 pButton = pButton_RestUI_Exit;
2753 pButton2 = pButton_RestUI_Exit; 2753 pButton2 = pButton_RestUI_Exit;
2754 pWindowType1 = (WindowType)96; 2754 pWindowType1 = (WindowType)96;
2755 //goto LABEL_731; 2755 //goto LABEL_731;
2758 //goto LABEL_732; 2758 //goto LABEL_732;
2759 v137 = 0; 2759 v137 = 0;
2760 v133 = 0; 2760 v133 = 0;
2761 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 2761 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
2762 continue; 2762 continue;
2763 case UIMSG_ShowStatus_Player|0x1: 2763 case UIMSG_Wait5Minutes:
2764 if ( dword_506F14 == 2 ) 2764 if ( dword_506F14 == 2 )
2765 //goto LABEL_621; 2765 //goto LABEL_621;
2766 { 2766 {
2767 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" 2767 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2768 goto LABEL_622; 2768 goto LABEL_622;
2770 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90, 2770 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90,
2771 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" 2771 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2772 dword_506F14 = v0; 2772 dword_506F14 = v0;
2773 _506F18_num_hours_to_sleep = 5; 2773 _506F18_num_hours_to_sleep = 5;
2774 continue; 2774 continue;
2775 case 0x60: 2775 case UIMSG_Wait1Hour:
2776 if ( dword_506F14 == 2 ) 2776 if ( dword_506F14 == 2 )
2777 //goto LABEL_621; 2777 //goto LABEL_621;
2778 { 2778 {
2779 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" 2779 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2780 goto LABEL_622; 2780 goto LABEL_622;
2798 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed; 2798 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
2799 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed; 2799 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
2800 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed; 2800 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
2801 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed; 2801 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
2802 continue; 2802 continue;
2803 case 0x68: 2803 case UIMSG_68:
2804 if ( pMessageQueue_50CBD0->uNumMessages ) 2804 if ( pMessageQueue_50CBD0->uNumMessages )
2805 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 2805 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2806 if ( pCurrentScreen ) 2806 if ( pCurrentScreen )
2807 continue; 2807 continue;
2808 if ( sub_42F4DA() ) 2808 if ( sub_42F4DA() )
2863 continue; 2863 continue;
2864 } 2864 }
2865 v176 = 0; 2865 v176 = 0;
2866 v160 = 13; 2866 v160 = 13;
2867 goto LABEL_619; 2867 goto LABEL_619;
2868 case 0x61: 2868 case UIMSG_61:
2869 if ( dword_506F14 ) 2869 if ( dword_506F14 )
2870 //goto LABEL_621; 2870 //goto LABEL_621;
2871 { 2871 {
2872 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" 2872 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2873 goto LABEL_622; 2873 goto LABEL_622;
2943 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed; 2943 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
2944 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed; 2944 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
2945 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed; 2945 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
2946 } 2946 }
2947 continue; 2947 continue;
2948 case UIMSG_ShowStatus_Funds|0x8: 2948 case UIMSG_AlreadyResting:
2949 if ( dword_506F14 == 2 ) 2949 if ( dword_506F14 == 2 )
2950 { 2950 {
2951 //LABEL_621: 2951 //LABEL_621:
2952 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" 2952 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2953 goto LABEL_622; 2953 goto LABEL_622;
2956 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" 2956 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
2957 v97 = sub_494820(pParty->uCurrentHour); 2957 v97 = sub_494820(pParty->uCurrentHour);
2958 dword_506F14 = v0; 2958 dword_506F14 = v0;
2959 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; 2959 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute;
2960 continue; 2960 continue;
2961 case 0x4E: 2961 case UIMSG_4E:
2962 if ( dword_50654C && byte_506550 ) 2962 if ( dword_50654C && byte_506550 )
2963 { 2963 {
2964 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName; 2964 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName;
2965 v157 = pGlobalTXT_LocalizationStrings[483]; 2965 v157 = pGlobalTXT_LocalizationStrings[483];
2966 _sprintex_2args_draw_status_and_continue: 2966 _sprintex_2args_draw_status_and_continue:
2975 strcpy(pTmpBuf, v177); 2975 strcpy(pTmpBuf, v177);
2976 } 2976 }
2977 //_set_status_string_pTmpBuf_and_continue: 2977 //_set_status_string_pTmpBuf_and_continue:
2978 sub_41C0B8_set_status_string(pTmpBuf); 2978 sub_41C0B8_set_status_string(pTmpBuf);
2979 continue; 2979 continue;
2980 case 0x4F: 2980 case UIMSG_4F:
2981 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], 2981 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
2982 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) 2982 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
2983 continue; 2983 continue;
2984 if ( sub_4637E0_is_there_popup_onscreen() ) 2984 if ( sub_4637E0_is_there_popup_onscreen() )
2985 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; 2985 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
2997 sprintf(pTmpBuf, v161, v178); 2997 sprintf(pTmpBuf, v161, v178);
2998 sub_41C0B8_set_status_string(pTmpBuf); 2998 sub_41C0B8_set_status_string(pTmpBuf);
2999 //goto LABEL_91; 2999 //goto LABEL_91;
3000 v0 = 1; 3000 v0 = 1;
3001 continue; 3001 continue;
3002 case 0x58: 3002 case UIMSG_58:
3003 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0); 3003 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0);
3004 if ( !uActiveCharacter ) 3004 if ( !uActiveCharacter )
3005 continue; 3005 continue;
3006 pPlayer10 = pPlayers[uActiveCharacter]; 3006 pPlayer10 = pPlayers[uActiveCharacter];
3007 if ( !byte_506550 || !dword_50654C ) 3007 if ( !byte_506550 || !dword_50654C )
3023 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); 3023 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter);
3024 if ( uActiveCharacter ) 3024 if ( uActiveCharacter )
3025 pPlayer10->PlaySound(12, 0); 3025 pPlayer10->PlaySound(12, 0);
3026 byte_506550 = 0; 3026 byte_506550 = 0;
3027 continue; 3027 continue;
3028 case 0x33: 3028 case UIMSG_33:
3029 if ( !uActiveCharacter ) 3029 if ( !uActiveCharacter )
3030 continue; 3030 continue;
3031 pPlayer3 = pPlayers[uActiveCharacter]; 3031 pPlayer3 = pPlayers[uActiveCharacter];
3032 pNPCData4 = 0; 3032 pNPCData4 = 0;
3033 uAction = 0; 3033 uAction = 0;
3081 v135 = -1; 3081 v135 = -1;
3082 v132 = 0; 3082 v132 = 0;
3083 v130 = 0; 3083 v130 = 0;
3084 v127 = rand() % 2 + 204; 3084 v127 = rand() % 2 + 204;
3085 goto _play_sound_and_continue; 3085 goto _play_sound_and_continue;
3086 case UIMSG_SaveGame|0x4: 3086 case UIMSG_57:
3087 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage ) 3087 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage )
3088 continue; 3088 continue;
3089 sub_41140B(); 3089 sub_41140B();
3090 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam; 3090 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam;
3091 pGUIWindow_CurrentMenu->OpenSpellBook(); 3091 pGUIWindow_CurrentMenu->OpenSpellBook();
3096 v135 = -1; 3096 v135 = -1;
3097 v132 = 0; 3097 v132 = 0;
3098 v130 = 0; 3098 v130 = 0;
3099 v127 = rand() % 2 + 204; 3099 v127 = rand() % 2 + 204;
3100 goto _play_sound_and_continue; 3100 goto _play_sound_and_continue;
3101 case UIMSG_LoadGame|0x4: 3101 case UIMSG_56:
3102 if ( pTurnEngine->field_4 != 3 ) 3102 if ( pTurnEngine->field_4 != 3 )
3103 { 3103 {
3104 if ( uActiveCharacter ) 3104 if ( uActiveCharacter )
3105 { 3105 {
3106 uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; 3106 uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
3109 if ( dword_50654C - 1 == uMessageParam ) 3109 if ( dword_50654C - 1 == uMessageParam )
3110 { 3110 {
3111 pGUIWindow_CurrentMenu->Release(); 3111 pGUIWindow_CurrentMenu->Release();
3112 pEventTimer->Resume(); 3112 pEventTimer->Resume();
3113 viewparams->bRedrawGameUI = v0; 3113 viewparams->bRedrawGameUI = v0;
3114 pCurrentScreen = 0; 3114 pCurrentScreen = SCREEN_GAME;
3115 pIcons_LOD->_4114F2(); 3115 pIcons_LOD->_4114F2();
3116 v103 = dword_50654C + 11 * *(char *)(uNumSeconds + 6734); 3116 v103 = dword_50654C + 11 * *(char *)(uNumSeconds + 6734);
3117 if ( dword_50C9E8 < 40 ) 3117 if ( dword_50C9E8 < 40 )
3118 { 3118 {
3119 dword_50C9EC[3 * dword_50C9E8] = 142; 3119 dword_50C9EC[3 * dword_50C9E8] = 142;
3129 } 3129 }
3130 } 3130 }
3131 } 3131 }
3132 } 3132 }
3133 continue; 3133 continue;
3134 case 0x8E: 3134 case UIMSG_8E:
3135 if ( pTurnEngine->field_4 == 3 ) 3135 if ( pTurnEngine->field_4 == 3 )
3136 continue; 3136 continue;
3137 v175 = 0; 3137 v175 = 0;
3138 v159 = 0; 3138 v159 = 0;
3139 v147 = 0; 3139 v147 = 0;
3140 //goto LABEL_678; 3140 //goto LABEL_678;
3141 v80 = v199; 3141 v80 = v199;
3142 v79 = uMessageParam; 3142 v79 = uMessageParam;
3143 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175); 3143 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
3144 continue; 3144 continue;
3145 case 0x92: 3145 case UIMSG_92:
3146 if ( pTurnEngine->field_4 != 3 ) 3146 if ( pTurnEngine->field_4 != 3 )
3147 { 3147 {
3148 v175 = 0; 3148 v175 = 0;
3149 v159 = v0; 3149 v159 = v0;
3150 v147 = 133; 3150 v147 = 133;
3153 v79 = uMessageParam; 3153 v79 = uMessageParam;
3154 //LABEL_679: 3154 //LABEL_679:
3155 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175); 3155 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
3156 } 3156 }
3157 continue; 3157 continue;
3158 case 0x69: 3158 case UIMSG_69:
3159 if ( pTurnEngine->field_4 == 3 ) 3159 if ( pTurnEngine->field_4 == 3 )
3160 continue; 3160 continue;
3161 if ( bUnderwater == 1 ) 3161 if ( bUnderwater == 1 )
3162 { 3162 {
3163 LABEL_682: 3163 LABEL_682:
3184 { 3184 {
3185 if ( !pCurrentScreen ) 3185 if ( !pCurrentScreen )
3186 //goto LABEL_693; 3186 //goto LABEL_693;
3187 { 3187 {
3188 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0); 3188 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
3189 pCurrentScreen = 8; 3189 pCurrentScreen = SCREEN_SPELL_BOOK;
3190 pEventTimer->Pause(); 3190 pEventTimer->Pause();
3191 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0); 3191 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
3192 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); 3192 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
3193 viewparams->field_48 = v0; 3193 viewparams->field_48 = v0;
3194 continue; 3194 continue;
3195 } 3195 }
3196 if ( pCurrentScreen != 5 3196 if ( pCurrentScreen != SCREEN_REST
3197 && pCurrentScreen != 7 3197 && pCurrentScreen != SCREEN_CHARACTERS
3198 && (pCurrentScreen <= 99 3198 && (pCurrentScreen <= SCREEN_63
3199 || pCurrentScreen > 103) ) 3199 || pCurrentScreen > SCREEN_67) )
3200 { 3200 {
3201 pGUIWindow_CurrentMenu->Release(); 3201 pGUIWindow_CurrentMenu->Release();
3202 //LABEL_693: 3202 //LABEL_693:
3203 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0); 3203 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
3204 pCurrentScreen = 8; 3204 pCurrentScreen = SCREEN_SPELL_BOOK;
3205 pEventTimer->Pause(); 3205 pEventTimer->Pause();
3206 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0); 3206 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
3207 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); 3207 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
3208 viewparams->field_48 = v0; 3208 viewparams->field_48 = v0;
3209 continue; 3209 continue;
3221 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 3221 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
3222 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_5A, (int)pBtn_QuickReference, 0); 3222 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_5A, (int)pBtn_QuickReference, 0);
3223 viewparams->bRedrawGameUI = v0; 3223 viewparams->bRedrawGameUI = v0;
3224 pEventTimer->Pause(); 3224 pEventTimer->Pause();
3225 pAudioPlayer->StopChannels(-1, -1); 3225 pAudioPlayer->StopChannels(-1, -1);
3226 pCurrentScreen = 104; 3226 pCurrentScreen = SCREEN_QUICK_REFERENCE;
3227 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0); 3227 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0);
3228 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); 3228 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
3229 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, 0x71u, 0, 0, 3229 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, 0x71u, 0, 0,
3230 pGlobalTXT_LocalizationStrings[79],// "Exit" 3230 pGlobalTXT_LocalizationStrings[79],// "Exit"
3231 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0); //, v179); 3231 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0); //, v179);
3232 continue; 3232 continue;
3233 case 0x6B: 3233 case UIMSG_6B:
3234 if ( pCurrentScreen ) 3234 if ( pCurrentScreen )
3235 { 3235 {
3236 pGUIWindow_CurrentMenu->Release(); 3236 pGUIWindow_CurrentMenu->Release();
3237 pEventTimer->Resume(); 3237 pEventTimer->Resume();
3238 pCurrentScreen = 0; 3238 pCurrentScreen = SCREEN_GAME;
3239 viewparams->bRedrawGameUI = v0; 3239 viewparams->bRedrawGameUI = v0;
3240 } 3240 }
3241 stru_506E40.Release(); 3241 stru_506E40.Release();
3242 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); 3242 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
3243 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 3243 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
3266 case UIMSG_AA: 3266 case UIMSG_AA:
3267 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Down, 0); 3267 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Down, 0);
3268 //LABEL_709: 3268 //LABEL_709:
3269 dword_506544 = v0; 3269 dword_506544 = v0;
3270 continue; 3270 continue;
3271 case 0x55: 3271 case UIMSG_55:
3272 bRingsShownInCharScreen ^= v0; 3272 bRingsShownInCharScreen ^= v0;
3273 GUIButton::_41D0D8(pCharacterScreen_DetalizBtn); 3273 GUIButton::_41D0D8(pCharacterScreen_DetalizBtn);
3274 GUIButton::_41D0D8(pCharacterScreen_DollBtn); 3274 GUIButton::_41D0D8(pCharacterScreen_DollBtn);
3275 if ( bRingsShownInCharScreen ) 3275 if ( bRingsShownInCharScreen )
3276 { 3276 {
3289 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, 0x55u, 0, 0, 3289 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, 0x55u, 0, 0,
3290 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" 3290 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
3291 0); 3291 0);
3292 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0); 3292 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0);
3293 goto LABEL_422; 3293 goto LABEL_422;
3294 case UIMSG_Quit|0x1: 3294 case UIMSG_85:
3295 OnPaperdollLeftClick(); 3295 OnPaperdollLeftClick();
3296 continue; 3296 continue;
3297 case UIMSG_Escape|0x2: 3297 case UIMSG_73:
3298 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 3298 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
3299 sub_4196A0(); 3299 sub_4196A0();
3300 sub_419379(); 3300 sub_419379();
3301 pButton = pCharacterScreen_StatsBtn; 3301 pButton = pCharacterScreen_StatsBtn;
3302 //goto LABEL_716; 3302 //goto LABEL_716;
3308 //goto LABEL_732; 3308 //goto LABEL_732;
3309 v137 = 0; 3309 v137 = 0;
3310 v133 = 0; 3310 v133 = 0;
3311 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 3311 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3312 continue; 3312 continue;
3313 case UIMSG_ChangeMusicVolume|0x2: 3313 case UIMSG_72:
3314 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; 3314 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
3315 sub_4196A0(); 3315 sub_4196A0();
3316 sub_419379(); 3316 sub_419379();
3317 CharacterUI_SkillScreen_Draw(); 3317 CharacterUI_SkillScreen_Draw();
3318 pButton = pCharacterScreen_SkillsBtn; 3318 pButton = pCharacterScreen_SkillsBtn;
3356 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" 3356 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
3357 } 3357 }
3358 //_draw_status_string_and_continue: 3358 //_draw_status_string_and_continue:
3359 ShowStatusBarString(v87, 2u); 3359 ShowStatusBarString(v87, 2u);
3360 continue; 3360 continue;
3361 case UIMSG_ChangeMusicVolume|0x4: 3361 case UIMSG_74:
3362 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; 3362 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
3363 sub_419379(); 3363 sub_419379();
3364 sub_4196A0(); 3364 sub_4196A0();
3365 pButton = pCharacterScreen_InventoryBtn; 3365 pButton = pCharacterScreen_InventoryBtn;
3366 //LABEL_716: 3366 //LABEL_716:
3386 //goto LABEL_732; 3386 //goto LABEL_732;
3387 v137 = 0; 3387 v137 = 0;
3388 v133 = 0; 3388 v133 = 0;
3389 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 3389 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3390 continue; 3390 continue;
3391 case UIMSG_Escape|0x4: 3391 case UIMSG_75:
3392 sub_419379(); 3392 sub_419379();
3393 sub_4196A0(); 3393 sub_4196A0();
3394 sub_419220(); 3394 sub_419220();
3395 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; 3395 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
3396 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), 3396 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42),
3397 (int)pCharacterScreen_AwardsBtn, 0); 3397 (int)pCharacterScreen_AwardsBtn, 0);
3398 sub_419100(); 3398 sub_419100();
3399 continue; 3399 continue;
3400 case 71://0x47: 3400 case UIMSG_AutonotesBook:
3401 switch ( uMessageParam ) 3401 switch ( uMessageParam )
3402 { 3402 {
3403 default: 3403 default:
3404 continue; 3404 continue;
3405 case 11: 3405 case 11:
3515 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" 3515 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points"
3516 v114 = v110->GetMaxHealth(); 3516 v114 = v110->GetMaxHealth();
3517 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); 3517 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
3518 sub_41C0B8_set_status_string(pTmpBuf); 3518 sub_41C0B8_set_status_string(pTmpBuf);
3519 continue; 3519 continue;
3520 case 0xC: 3520 case UIMSG_C:
3521 if ( pCurrentScreen == 15 ) 3521 if ( pCurrentScreen == SCREEN_F )
3522 { 3522 {
3523 sub_421EA6_OnInventoryLeftClick(); 3523 sub_421EA6_OnInventoryLeftClick();
3524 continue; 3524 continue;
3525 } 3525 }
3526 sub_420E01(); 3526 sub_420E01();
3527 continue; 3527 continue;
3528 case UIMSG_ChangeMusicVolume|0x8: 3528 case UIMSG_InventoryLeftClick:
3529 sub_421EA6_OnInventoryLeftClick(); 3529 sub_421EA6_OnInventoryLeftClick();
3530 continue; 3530 continue;
3531 case 0xA: 3531 case UIMSG_A:
3532 if ( !pRenderer->pRenderD3D ) 3532 if ( !pRenderer->pRenderD3D )
3533 //goto LABEL_772; 3533 //goto LABEL_772;
3534 { 3534 {
3535 if ( pMessageQueue_50CBD0->uNumMessages ) 3535 if ( pMessageQueue_50CBD0->uNumMessages )
3536 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3536 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3576 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3576 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3577 ++pMessageQueue_50CBD0->uNumMessages; 3577 ++pMessageQueue_50CBD0->uNumMessages;
3578 continue; 3578 continue;
3579 } 3579 }
3580 continue; 3580 continue;
3581 case 0xE: 3581 case UIMSG_E:
3582 //LABEL_772: 3582 //LABEL_772:
3583 if ( pMessageQueue_50CBD0->uNumMessages ) 3583 if ( pMessageQueue_50CBD0->uNumMessages )
3584 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3584 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3585 OnGameViewportClick(); 3585 OnGameViewportClick();
3586 continue; 3586 continue;
3587 case 0xF: 3587 case UIMSG_F:
3588 if ( pRenderer->pRenderD3D ) 3588 if ( pRenderer->pRenderD3D )
3589 { 3589 {
3590 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); 3590 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val();
3591 } 3591 }
3592 else 3592 else
3603 v9 = 0; 3603 v9 = 0;
3604 v137 = 0; 3604 v137 = 0;
3605 v133 = 0; 3605 v133 = 0;
3606 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 3606 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3607 continue; 3607 continue;
3608 case 0x54: 3608 case UIMSG_54:
3609 v163 = 0; 3609 v163 = 0;
3610 pButton2 = (GUIButton *)uMessageParam; 3610 pButton2 = (GUIButton *)uMessageParam;
3611 pWindowType1 = (WindowType)22; 3611 pWindowType1 = (WindowType)22;
3612 //LABEL_779: 3612 //LABEL_779:
3613 v8 = 0; 3613 v8 = 0;
3616 v137 = 0; 3616 v137 = 0;
3617 v133 = 0; 3617 v133 = 0;
3618 //LABEL_733: 3618 //LABEL_733:
3619 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 3619 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3620 continue; 3620 continue;
3621 case 0x194: 3621 case UIMSG_194:
3622 if ( pMessageQueue_50CBD0->uNumMessages ) 3622 if ( pMessageQueue_50CBD0->uNumMessages )
3623 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3623 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3624 OnPressSpace(); 3624 OnPressSpace();
3625 continue; 3625 continue;
3626 case UIMSG_ChangeSoundVolume|0x100: 3626 case UIMSG_16F:
3627 if ( pCurrentScreen ) 3627 if ( pCurrentScreen )
3628 continue; 3628 continue;
3629 pParty->uFlags |= 2u; 3629 pParty->uFlags |= 2u;
3630 GUIWindow::Create(0x207u, 0x88u, 0, 0, (enum WindowType)90, (int)dword_507A14, 0); 3630 GUIWindow::Create(0x207u, 0x88u, 0, 0, (enum WindowType)90, (int)dword_507A14, 0);
3631 uNumSeconds = 131072; 3631 uNumSeconds = 131072;
3644 v119 = 2048; 3644 v119 = 2048;
3645 if ( (signed int)v118 <= 2048 ) 3645 if ( (signed int)v118 <= 2048 )
3646 goto LABEL_789; 3646 goto LABEL_789;
3647 viewparams->field_28 = 11; 3647 viewparams->field_28 = 11;
3648 goto LABEL_788; 3648 goto LABEL_788;
3649 case UIMSG_ChangeMusicVolume|0x100: 3649 case UIMSG_170:
3650 if ( pCurrentScreen ) 3650 if ( pCurrentScreen )
3651 continue; 3651 continue;
3652 pParty->uFlags |= 2u; 3652 pParty->uFlags |= 2u;
3653 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, (enum WindowType)90, (int)dword_507A18, 0); 3653 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, (enum WindowType)90, (int)dword_507A18, 0);
3654 uNumSeconds = 32768; 3654 uNumSeconds = 32768;
3828 case UIMSG_SelectLoadSlot: // Выбранный слот сохранёнки 3828 case UIMSG_SelectLoadSlot: // Выбранный слот сохранёнки
3829 { 3829 {
3830 //main menu save/load wnd clicking on savegame lines 3830 //main menu save/load wnd clicking on savegame lines
3831 if (pGUIWindow_CurrentMenu->field_40 == 1) 3831 if (pGUIWindow_CurrentMenu->field_40 == 1)
3832 pKeyActionMap->_459ED1(0); 3832 pKeyActionMap->_459ED1(0);
3833 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition ) 3833 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
3834 { 3834 {
3835 //load clicked line 3835 //load clicked line
3836 v26 = uNum + pSaveListPosition; 3836 v26 = uNum + pSaveListPosition;
3837 if ( dword_6BE138 == uNum + pSaveListPosition ) 3837 if ( dword_6BE138 == uNum + pSaveListPosition )
3838 { 3838 {
3958 __debugbreak(); 3958 __debugbreak();
3959 if ( pCurrentScreen ) 3959 if ( pCurrentScreen )
3960 { 3960 {
3961 pGUIWindow_CurrentMenu->Release(); 3961 pGUIWindow_CurrentMenu->Release();
3962 pEventTimer->Resume(); 3962 pEventTimer->Resume();
3963 pCurrentScreen = 0; 3963 pCurrentScreen = SCREEN_GAME;
3964 viewparams->bRedrawGameUI = 1; 3964 viewparams->bRedrawGameUI = 1;
3965 } 3965 }
3966 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 3966 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0);
3967 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3967 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3968 continue; 3968 continue;
4021 } 4021 }
4022 v16 = GetCurrentMenuID() == 8; 4022 v16 = GetCurrentMenuID() == 8;
4023 v17 = pCurrentScreen; 4023 v17 = pCurrentScreen;
4024 if ( v16 && !pCurrentScreen ) 4024 if ( v16 && !pCurrentScreen )
4025 goto LABEL_83; 4025 goto LABEL_83;
4026 if ( pCurrentScreen == 12 ) 4026 if ( pCurrentScreen == SCREEN_LOADGAME )
4027 { 4027 {
4028 pIcons_LOD->_4114F2(); 4028 pIcons_LOD->_4114F2();
4029 //crt_deconstruct_ptr_6A0118(); 4029 //crt_deconstruct_ptr_6A0118();
4030 pTexture_PCX.Release(); 4030 pTexture_PCX.Release();
4031 pTexture_PCX.Load("title.pcx", 0); 4031 pTexture_PCX.Load("title.pcx", 0);
4034 //LABEL_81: 4034 //LABEL_81:
4035 pGUIWindow_CurrentMenu->Release(); 4035 pGUIWindow_CurrentMenu->Release();
4036 pGUIWindow2->Release(); 4036 pGUIWindow2->Release();
4037 pGUIWindow2 = 0; 4037 pGUIWindow2 = 0;
4038 pEventTimer->Resume(); 4038 pEventTimer->Resume();
4039 pCurrentScreen = 0; 4039 pCurrentScreen = SCREEN_GAME;
4040 viewparams->bRedrawGameUI = v15; 4040 viewparams->bRedrawGameUI = v15;
4041 continue; 4041 continue;
4042 } 4042 }
4043 if ( pCurrentScreen == 16 ) 4043 if ( pCurrentScreen == SCREEN_VIDEO )
4044 { 4044 {
4045 pVideoPlayer->Unload(); 4045 pVideoPlayer->Unload();
4046 } 4046 }
4047 else 4047 else
4048 { 4048 {
4049 if ( pCurrentScreen != 27 ) 4049 if ( pCurrentScreen != SCREEN_1B )
4050 //goto LABEL_81; 4050 //goto LABEL_81;
4051 { 4051 {
4052 pGUIWindow_CurrentMenu->Release(); 4052 pGUIWindow_CurrentMenu->Release();
4053 pGUIWindow2->Release(); 4053 pGUIWindow2->Release();
4054 pGUIWindow2 = 0; 4054 pGUIWindow2 = 0;
4055 pEventTimer->Resume(); 4055 pEventTimer->Resume();
4056 pCurrentScreen = 0; 4056 pCurrentScreen = SCREEN_GAME;
4057 viewparams->bRedrawGameUI = v15; 4057 viewparams->bRedrawGameUI = v15;
4058 continue; 4058 continue;
4059 } 4059 }
4060 //VideoPlayer::dtor(); 4060 //VideoPlayer::dtor();
4061 } 4061 }
14361 v3 = a4; 14361 v3 = a4;
14362 pEventTimer->Pause(); 14362 pEventTimer->Pause();
14363 dword_506F0C[0] = pCurrentScreen; 14363 dword_506F0C[0] = pCurrentScreen;
14364 result = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, v3, (int)v2); 14364 result = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, v3, (int)v2);
14365 ptr_507BDC = result; 14365 ptr_507BDC = result;
14366 pCurrentScreen = 22; 14366 pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE;
14367 return result; 14367 return result;
14368 } 14368 }
14369 // 4E28F8: using guessed type int pCurrentScreen; 14369 // 4E28F8: using guessed type int pCurrentScreen;
14370 14370
14371 //----- (0041420D) -------------------------------------------------------- 14371 //----- (0041420D) --------------------------------------------------------
15040 pHint = pWindow->Hint; 15040 pHint = pWindow->Hint;
15041 viewparams->bRedrawGameUI = 1; 15041 viewparams->bRedrawGameUI = 1;
15042 if ( pHint && pHint != (char *)1 ) 15042 if ( pHint && pHint != (char *)1 )
15043 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); 15043 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
15044 pWindow->Release(); 15044 pWindow->Release();
15045 if (pCurrentScreen == 11)//окно сохранения игры 15045 if (pCurrentScreen == SCREEN_SAVEGAME)
15046 pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0); 15046 pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0);
15047 else 15047 else
15048 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0); 15048 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0);
15049 } 15049 }
15050 continue; 15050 continue;
15107 if ( !pKeyActionMap->field_204 ) 15107 if ( !pKeyActionMap->field_204 )
15108 { 15108 {
15109 ItemGen2.Reset(); 15109 ItemGen2.Reset();
15110 pWindow->Release(); 15110 pWindow->Release();
15111 pEventTimer->Resume(); 15111 pEventTimer->Resume();
15112 pCurrentScreen = 0; 15112 pCurrentScreen = SCREEN_GAME;
15113 viewparams->bRedrawGameUI = 1; 15113 viewparams->bRedrawGameUI = 1;
15114 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); 15114 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
15115 if ( v39 > 0 ) 15115 if ( v39 > 0 )
15116 { 15116 {
15117 if ( v39 < 800 ) 15117 if ( v39 < 800 )
15208 if ( !pKeyActionMap->field_204 ) 15208 if ( !pKeyActionMap->field_204 )
15209 { 15209 {
15210 pItemGen.Reset(); 15210 pItemGen.Reset();
15211 pWindow->Release(); 15211 pWindow->Release();
15212 pEventTimer->Resume(); 15212 pEventTimer->Resume();
15213 pCurrentScreen = 0; 15213 pCurrentScreen = SCREEN_GAME;
15214 viewparams->bRedrawGameUI = 1; 15214 viewparams->bRedrawGameUI = 1;
15215 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); 15215 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
15216 if ( v26 > 0 ) 15216 if ( v26 > 0 )
15217 { 15217 {
15218 if ( v26 < 800 ) 15218 if ( v26 < 800 )
15369 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15369 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15370 ++pMessageQueue_50CBD0->uNumMessages; 15370 ++pMessageQueue_50CBD0->uNumMessages;
15371 } 15371 }
15372 pEventTimer->Resume(); 15372 pEventTimer->Resume();
15373 ptr_507BD0->Release(); 15373 ptr_507BD0->Release();
15374 pCurrentScreen = 0; 15374 pCurrentScreen = SCREEN_GAME;
15375 //goto LABEL_114; 15375 //goto LABEL_114;
15376 viewparams->bRedrawGameUI = 1; 15376 viewparams->bRedrawGameUI = 1;
15377 continue; 15377 continue;
15378 } 15378 }
15379 if ( ptr_507BD0->field_40 == 3 ) 15379 if ( ptr_507BD0->field_40 == 3 )
15444 sub_4606FE(); 15444 sub_4606FE();
15445 } 15445 }
15446 } 15446 }
15447 else//pWindowType == 20 (0x14) WINDOW_Chest 15447 else//pWindowType == 20 (0x14) WINDOW_Chest
15448 { 15448 {
15449 if ( pCurrentScreen == 10 ) 15449 if ( pCurrentScreen == SCREEN_CHEST )
15450 { 15450 {
15451 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); 15451 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
15452 } 15452 }
15453 else 15453 else
15454 { 15454 {
15455 if ( pCurrentScreen == 15 ) 15455 if ( pCurrentScreen == SCREEN_F )
15456 { 15456 {
15457 pRenderer->ClearZBuffer(0, 479); 15457 pRenderer->ClearZBuffer(0, 479);
15458 draw_leather(); 15458 draw_leather();
15459 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 15459 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
15460 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, 15460 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
16167 char *v29; // [sp+68h] [bp-10h]@33 16167 char *v29; // [sp+68h] [bp-10h]@33
16168 float v30; // [sp+6Ch] [bp-Ch]@33 16168 float v30; // [sp+6Ch] [bp-Ch]@33
16169 unsigned int pX; // [sp+70h] [bp-8h]@3 16169 unsigned int pX; // [sp+70h] [bp-8h]@3
16170 unsigned int pY; // [sp+74h] [bp-4h]@3 16170 unsigned int pY; // [sp+74h] [bp-4h]@3
16171 16171
16172 if ( pCurrentScreen == 16 )//окно видео ролика 16172 if ( pCurrentScreen == SCREEN_VIDEO )
16173 return; 16173 return;
16174 if ( _this ) 16174 if ( _this )
16175 { 16175 {
16176 pX = _this->x; 16176 pX = _this->x;
16177 pY = _this->y; 16177 pY = _this->y;
16205 //++v1; 16205 //++v1;
16206 } 16206 }
16207 //while ( v1 < 4 ); 16207 //while ( v1 < 4 );
16208 } 16208 }
16209 pEventTimer->Pause(); 16209 pEventTimer->Pause();
16210 if ( pCurrentScreen <= 10 ) 16210 if ( pCurrentScreen <= SCREEN_CHEST )
16211 { 16211 {
16212 if ( pCurrentScreen == 10 )//окно ящика 16212 if ( pCurrentScreen == SCREEN_CHEST )
16213 { 16213 {
16214 __debugbreak(); 16214 __debugbreak();
16215 if ( !pPlayers[uActiveCharacter]->CanAct() ) 16215 if ( !pPlayers[uActiveCharacter]->CanAct() )
16216 { 16216 {
16217 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s 16217 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s
16236 } 16236 }
16237 else 16237 else
16238 { 16238 {
16239 if ( pCurrentScreen ) 16239 if ( pCurrentScreen )
16240 { 16240 {
16241 if ( pCurrentScreen != 3 ) 16241 if ( pCurrentScreen != SCREEN_BOOKS )
16242 { 16242 {
16243 if ( pCurrentScreen != 7 ) 16243 if ( pCurrentScreen != SCREEN_CHARACTERS )
16244 { 16244 {
16245 if ( pCurrentScreen == 8 )//окно книги заклов 16245 if ( pCurrentScreen == SCREEN_SPELL_BOOK )
16246 { 16246 {
16247 if ( dword_507B00_spell_info_to_draw_in_popup ) 16247 if ( dword_507B00_spell_info_to_draw_in_popup )
16248 DrawSpellDescriptionPopup((void *)(dword_507B00_spell_info_to_draw_in_popup - 1)); 16248 DrawSpellDescriptionPopup((void *)(dword_507B00_spell_info_to_draw_in_popup - 1));
16249 } 16249 }
16250 goto LABEL_132; 16250 goto LABEL_132;
16251 } 16251 }
16252 LABEL_119: 16252 LABEL_119:
16253 if ( (signed int)pX > 467 && pCurrentScreen != 14 ) 16253 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
16254 { 16254 {
16255 identify_item(); 16255 identify_item();
16256 goto LABEL_132; 16256 goto LABEL_132;
16257 } 16257 }
16258 if ( (signed int)pY >= 345 ) 16258 if ( (signed int)pY >= 345 )
16386 v8 = &pLayingItems[v7].stru_24; 16386 v8 = &pLayingItems[v7].stru_24;
16387 } 16387 }
16388 GameUI_DrawItemInfo(v8); 16388 GameUI_DrawItemInfo(v8);
16389 goto LABEL_132; 16389 goto LABEL_132;
16390 } 16390 }
16391 if ( pCurrentScreen == 13 )//окно дома 16391 if ( pCurrentScreen == SCREEN_HOUSE )
16392 { 16392 {
16393 if ( (signed int)pY < 345 && (signed int)pX < 469 ) 16393 if ( (signed int)pY < 345 && (signed int)pX < 469 )
16394 sub_4B1A2D(); 16394 sub_4B1A2D();
16395 goto LABEL_132; 16395 goto LABEL_132;
16396 } 16396 }
16397 if ( pCurrentScreen <= 13 ) 16397 if ( pCurrentScreen <= SCREEN_HOUSE )
16398 goto LABEL_132; 16398 goto LABEL_132;
16399 if ( pCurrentScreen <= 15 ) 16399 if ( pCurrentScreen <= SCREEN_F )
16400 goto LABEL_119; 16400 goto LABEL_119;
16401 if ( pCurrentScreen != 21 ) 16401 if ( pCurrentScreen != SCREEN_PARTY_CREATION )
16402 { 16402 {
16403 v11 = pCurrentScreen == 23; 16403 v11 = pCurrentScreen == SCREEN_CASTING;
16404 if ( !v11 ) 16404 if ( !v11 )
16405 goto LABEL_132; 16405 goto LABEL_132;
16406 identify_item(); 16406 identify_item();
16407 goto LABEL_132; 16407 goto LABEL_132;
16408 } 16408 }
16508 int v11; // ecx@52 16508 int v11; // ecx@52
16509 unsigned int pX; // [sp+14h] [bp-8h]@7 16509 unsigned int pX; // [sp+14h] [bp-8h]@7
16510 unsigned int pY; // [sp+18h] [bp-4h]@7 16510 unsigned int pY; // [sp+18h] [bp-4h]@7
16511 16511
16512 pXY_ = pXY; 16512 pXY_ = pXY;
16513 if ( pCurrentScreen == 16 16513 if ( pCurrentScreen == SCREEN_VIDEO
16514 || sub_4637E0_is_there_popup_onscreen() ) 16514 || sub_4637E0_is_there_popup_onscreen() )
16515 return; 16515 return;
16516 if ( pGUIWindow2 && pGUIWindow2->ptr_1C == (void *)33 ) 16516 if ( pGUIWindow2 && pGUIWindow2->ptr_1C == (void *)33 )
16517 { 16517 {
16518 sub_4452BB(); 16518 sub_4452BB();