Mercurial > mm7
comparison Game/Game.cpp @ 2542:bacf9809126a
.
author | a.parshin |
---|---|
date | Sun, 10 May 2015 02:04:52 +0200 |
parents | a902abdfc7f2 |
children | b6140dfeac27 |
comparison
equal
deleted
inserted
replaced
2541:a902abdfc7f2 | 2542:bacf9809126a |
---|---|
681 viewparams->bRedrawGameUI = 1; | 681 viewparams->bRedrawGameUI = 1; |
682 stru_506E40.Release(); | 682 stru_506E40.Release(); |
683 continue; | 683 continue; |
684 case UIMSG_OpenQuestBook: | 684 case UIMSG_OpenQuestBook: |
685 DoThatMessageThing(); | 685 DoThatMessageThing(); |
686 if (current_screen_type) | 686 if (current_screen_type != SCREEN_GAME) |
687 pGUIWindow_CurrentMenu->Release(); | 687 pGUIWindow_CurrentMenu->Release(); |
688 pEventTimer->Pause(); | 688 pEventTimer->Pause(); |
689 pAudioPlayer->StopChannels(-1, -1); | 689 pAudioPlayer->StopChannels(-1, -1); |
690 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); | 690 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
691 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); | 691 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); |
692 bFlashQuestBook = 0; | 692 bFlashQuestBook = 0; |
693 continue; | 693 continue; |
694 case UIMSG_OpenAutonotes: | 694 case UIMSG_OpenAutonotes: |
695 DoThatMessageThing(); | 695 DoThatMessageThing(); |
696 if (current_screen_type) | 696 if (current_screen_type != SCREEN_GAME) |
697 pGUIWindow_CurrentMenu->Release(); | 697 pGUIWindow_CurrentMenu->Release(); |
698 pEventTimer->Pause(); | 698 pEventTimer->Pause(); |
699 pAudioPlayer->StopChannels(-1, -1); | 699 pAudioPlayer->StopChannels(-1, -1); |
700 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); | 700 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
701 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); | 701 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); |
702 bFlashAutonotesBook = 0; | 702 bFlashAutonotesBook = 0; |
703 continue; | 703 continue; |
704 case UIMSG_OpenMapBook: | 704 case UIMSG_OpenMapBook: |
705 DoThatMessageThing(); | 705 DoThatMessageThing(); |
706 if (current_screen_type) | 706 if (current_screen_type != SCREEN_GAME) |
707 pGUIWindow_CurrentMenu->Release(); | 707 pGUIWindow_CurrentMenu->Release(); |
708 pEventTimer->Pause(); | 708 pEventTimer->Pause(); |
709 viewparams->sViewCenterX = pParty->vPosition.x; | 709 viewparams->sViewCenterX = pParty->vPosition.x; |
710 viewparams->sViewCenterY = pParty->vPosition.y; | 710 viewparams->sViewCenterY = pParty->vPosition.y; |
711 pAudioPlayer->StopChannels(-1, -1); | 711 pAudioPlayer->StopChannels(-1, -1); |
712 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); | 712 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
713 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); | 713 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); |
714 continue; | 714 continue; |
715 case UIMSG_OpenCalendar: | 715 case UIMSG_OpenCalendar: |
716 DoThatMessageThing(); | 716 DoThatMessageThing(); |
717 if (current_screen_type) | 717 if (current_screen_type != SCREEN_GAME) |
718 pGUIWindow_CurrentMenu->Release(); | 718 pGUIWindow_CurrentMenu->Release(); |
719 pEventTimer->Pause(); | 719 pEventTimer->Pause(); |
720 pAudioPlayer->StopChannels(-1, -1); | 720 pAudioPlayer->StopChannels(-1, -1); |
721 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); | 721 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
722 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); | 722 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); |
723 continue; | 723 continue; |
724 case UIMSG_OpenHistoryBook: | 724 case UIMSG_OpenHistoryBook: |
725 DoThatMessageThing(); | 725 DoThatMessageThing(); |
726 if (current_screen_type) | 726 if (current_screen_type != SCREEN_GAME) |
727 pGUIWindow_CurrentMenu->Release(); | 727 pGUIWindow_CurrentMenu->Release(); |
728 pEventTimer->Pause(); | 728 pEventTimer->Pause(); |
729 pAudioPlayer->StopChannels(-1, -1); | 729 pAudioPlayer->StopChannels(-1, -1); |
730 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); | 730 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
731 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); | 731 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); |
761 if (!pModalWindow) | 761 if (!pModalWindow) |
762 { | 762 { |
763 pRenderer->ClearZBuffer(0, 479); | 763 pRenderer->ClearZBuffer(0, 479); |
764 viewparams->bRedrawGameUI = 1; | 764 viewparams->bRedrawGameUI = 1; |
765 viewparams->field_48 = 1; | 765 viewparams->field_48 = 1; |
766 if (current_screen_type) | 766 if (current_screen_type != SCREEN_GAME) |
767 { | 767 { |
768 if (current_screen_type > SCREEN_67) | 768 if (current_screen_type > SCREEN_67) |
769 { | 769 { |
770 if (current_screen_type == SCREEN_QUICK_REFERENCE) | 770 if (current_screen_type == SCREEN_QUICK_REFERENCE) |
771 { | 771 { |
1263 | 1263 |
1264 ++pIcons_LOD->uTexturePacksCount; | 1264 ++pIcons_LOD->uTexturePacksCount; |
1265 if (!pIcons_LOD->uNumPrevLoadedFiles) | 1265 if (!pIcons_LOD->uNumPrevLoadedFiles) |
1266 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | 1266 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; |
1267 | 1267 |
1268 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0); | 1268 pGUIWindow_CurrentMenu = GameMenuUI_Load(); |
1269 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); | 1269 |
1270 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
1271 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
1272 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
1273 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
1274 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
1275 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
1276 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, | |
1277 pGlobalTXT_LocalizationStrings[614],// "New Game" | |
1278 pIcons_LOD->GetTexture(uTextureID_New1), 0); | |
1279 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, | |
1280 pGlobalTXT_LocalizationStrings[615],// "Save Game" | |
1281 pIcons_LOD->GetTexture(uTextureID_Save1), 0); | |
1282 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, | |
1283 pGlobalTXT_LocalizationStrings[616],// "Load Game" | |
1284 pIcons_LOD->GetTexture(uTextureID_Load1), 0); | |
1285 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, | |
1286 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" | |
1287 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); | |
1288 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, | |
1289 pGlobalTXT_LocalizationStrings[618],// "Quit" | |
1290 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); | |
1291 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, | |
1292 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
1293 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); | |
1294 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); | |
1295 viewparams->field_48 = 1; | 1270 viewparams->field_48 = 1; |
1296 | 1271 |
1297 stru_506E40.Release(); | 1272 stru_506E40.Release(); |
1298 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); | 1273 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
1299 stru_506E40.LoadPCXFile("gamma.pcx", 0); | 1274 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
1308 back_to_game(); | 1283 back_to_game(); |
1309 continue; | 1284 continue; |
1310 } | 1285 } |
1311 ModalWindow_Release(); | 1286 ModalWindow_Release(); |
1312 continue; | 1287 continue; |
1288 | |
1313 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel | 1289 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel |
1314 if (uMessageParam) | 1290 if (uMessageParam) |
1315 { | 1291 { |
1316 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); | 1292 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); |
1317 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; | 1293 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; |
1332 pParty->field_709 = 0; | 1308 pParty->field_709 = 0; |
1333 }*/ | 1309 }*/ |
1334 } | 1310 } |
1335 GameUI_DrawHiredNPCs(); | 1311 GameUI_DrawHiredNPCs(); |
1336 continue; | 1312 continue; |
1313 | |
1337 case UIMSG_TransitionUI_Confirm: | 1314 case UIMSG_TransitionUI_Confirm: |
1338 DoThatMessageThing(); | 1315 DoThatMessageThing(); |
1339 dword_50CDC8 = 1; | 1316 dword_50CDC8 = 1; |
1340 sub_42FBDD(); | 1317 sub_42FBDD(); |
1341 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); | 1318 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); |
1506 pParty->vPosition.y = -22528; | 1483 pParty->vPosition.y = -22528; |
1507 if (pParty->vPosition.y > 22528) | 1484 if (pParty->vPosition.y > 22528) |
1508 pParty->vPosition.y = 22528; | 1485 pParty->vPosition.y = 22528; |
1509 DialogueEnding(); | 1486 DialogueEnding(); |
1510 current_screen_type = SCREEN_GAME; | 1487 current_screen_type = SCREEN_GAME; |
1511 viewparams->bRedrawGameUI = 1; | 1488 viewparams->bRedrawGameUI = true; |
1512 continue; | 1489 continue; |
1513 case UIMSG_CastSpell_Telekinesis: | 1490 case UIMSG_CastSpell_Telekinesis: |
1514 //if ( pRenderer->pRenderD3D ) | 1491 //if ( pRenderer->pRenderD3D ) |
1515 LOWORD(v42) = pEngine->pVisInstance->get_picked_object_zbuf_val(); | 1492 LOWORD(v42) = pEngine->pVisInstance->get_picked_object_zbuf_val(); |
1516 /*else | 1493 /*else |
1640 GameUI_Footer_TimeLeft = 0; | 1617 GameUI_Footer_TimeLeft = 0; |
1641 _50C9A0_IsEnchantingInProgress = 0; | 1618 _50C9A0_IsEnchantingInProgress = 0; |
1642 } | 1619 } |
1643 } | 1620 } |
1644 continue; | 1621 continue; |
1622 | |
1645 case UIMSG_BF: | 1623 case UIMSG_BF: |
1646 __debugbreak(); | 1624 __debugbreak(); |
1647 dword_50CDC8 = 1; | 1625 dword_50CDC8 = 1; |
1648 sub_42FBDD(); | 1626 sub_42FBDD(); |
1649 SaveGame(1, 0); | 1627 SaveGame(1, 0); |