comparison Game/Game.cpp @ 2544:c674d547cc7c

GUIWindow switch logic refactored into behaviour classes
author a.parshin
date Mon, 11 May 2015 09:51:04 +0200
parents b6140dfeac27
children 4087cbc62706
comparison
equal deleted inserted replaced
2543:b6140dfeac27 2544:c674d547cc7c
326 __debugbreak(); 326 __debugbreak();
327 pIcons_LOD->SyncLoadedFilesCount(); 327 pIcons_LOD->SyncLoadedFilesCount();
328 pIcons_LOD->RemoveTexturesPackFromTextureList(); 328 pIcons_LOD->RemoveTexturesPackFromTextureList();
329 pGUIWindow_CurrentMenu->Release(); 329 pGUIWindow_CurrentMenu->Release();
330 current_screen_type = SCREEN_OPTIONS; 330 current_screen_type = SCREEN_OPTIONS;
331 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0); 331 __debugbreak();//pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
332 continue; 332 continue;
333 case UIMSG_ArrowUp: 333 case UIMSG_ArrowUp:
334 --pSaveListPosition; 334 --pSaveListPosition;
335 if (pSaveListPosition < 0) 335 if (pSaveListPosition < 0)
336 pSaveListPosition = 0; 336 pSaveListPosition = 0;
337 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); 337 new OnButtonClick2(215, 199, 17, 17, (int)pBtnArrowUp, 0);
338 continue; 338 continue;
339 case UIMSG_DownArrow: 339 case UIMSG_DownArrow:
340 ++pSaveListPosition; 340 ++pSaveListPosition;
341 if (pSaveListPosition >= uMessageParam) 341 if (pSaveListPosition >= uMessageParam)
342 pSaveListPosition = uMessageParam - 1; 342 pSaveListPosition = uMessageParam - 1;
343 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); 343 new OnButtonClick2(215, 323, 17, 17, (int)pBtnDownArrow, 0);
344 continue; 344 continue;
345 case UIMSG_Cancel: 345 case UIMSG_Cancel:
346 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0); 346 new OnCancel(350, 302, 106, 42, (int)pBtnCancel, 0);
347 continue; 347 continue;
348 case UIMSG_SaveLoadBtn: 348 case UIMSG_SaveLoadBtn:
349 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); 349 new OnSaveLoad(241, 302, 106, 42, (int)pBtnLoadSlot, 0);
350 continue; 350 continue;
351 case UIMSG_SelectLoadSlot: 351 case UIMSG_SelectLoadSlot:
352 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) 352 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
353 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); 353 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
354 if (current_screen_type != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam) 354 if (current_screen_type != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam)
488 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0); 488 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
489 continue; 489 continue;
490 } 490 }
491 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; 491 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
492 //pEngine->pGammaController->Initialize(v19); 492 //pEngine->pGammaController->Initialize(v19);
493 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); 493 new OnButtonClick2(21, 161, 0, 0, (int)pBtn_SliderLeft, (char *)1);
494 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0); 494 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
495 continue; 495 continue;
496 } 496 }
497 if (uMessageParam == 5) 497 if (uMessageParam == 5)
498 { 498 {
499 ++uGammaPos; 499 ++uGammaPos;
500 if ((signed int)uGammaPos <= 9) 500 if ((signed int)uGammaPos <= 9)
501 { 501 {
502 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; 502 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
503 //pEngine->pGammaController->Initialize(v21); 503 //pEngine->pGammaController->Initialize(v21);
504 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); 504 new OnButtonClick2(213, 161, 0, 0, (int)pBtn_SliderRight, (char *)1);
505 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0); 505 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
506 continue; 506 continue;
507 } 507 }
508 uGammaPos = 9; 508 uGammaPos = 9;
509 } 509 }
529 if (uMessageParam == 4)//- 529 if (uMessageParam == 4)//-
530 { 530 {
531 --uMusicVolimeMultiplier; 531 --uMusicVolimeMultiplier;
532 if ((char)uMusicVolimeMultiplier < 1) 532 if ((char)uMusicVolimeMultiplier < 1)
533 uMusicVolimeMultiplier = 0; 533 uMusicVolimeMultiplier = 0;
534 GUIWindow::Create(243, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); 534 new OnButtonClick2(243, 216, 0, 0, (int)pBtn_SliderLeft, (char *)1);
535 if (uMusicVolimeMultiplier) 535 if (uMusicVolimeMultiplier)
536 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); 536 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
537 537
538 if (use_music_folder) 538 if (use_music_folder)
539 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); 539 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
545 if (uMessageParam == 5)//+ 545 if (uMessageParam == 5)//+
546 { 546 {
547 ++uMusicVolimeMultiplier; 547 ++uMusicVolimeMultiplier;
548 if ((char)uMusicVolimeMultiplier > 9) 548 if ((char)uMusicVolimeMultiplier > 9)
549 uMusicVolimeMultiplier = 9; 549 uMusicVolimeMultiplier = 9;
550 GUIWindow::Create(435, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); 550 new OnButtonClick2(435, 216, 0, 0, (int)pBtn_SliderRight, (char *)1);
551 if (uMusicVolimeMultiplier) 551 if (uMusicVolimeMultiplier)
552 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); 552 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
553 if (use_music_folder) 553 if (use_music_folder)
554 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]); 554 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
555 else 555 else
570 if (uMessageParam == 4)//reduce sound level button left 570 if (uMessageParam == 4)//reduce sound level button left
571 { 571 {
572 --uSoundVolumeMultiplier; 572 --uSoundVolumeMultiplier;
573 if ((char)uSoundVolumeMultiplier < 1) 573 if ((char)uSoundVolumeMultiplier < 1)
574 uSoundVolumeMultiplier = 0; 574 uSoundVolumeMultiplier = 0;
575 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); 575 new OnButtonClick2(243, 162, 0, 0, (int)pBtn_SliderLeft, (char *)1);
576 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 576 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
577 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0); 577 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
578 int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook); 578 int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
579 //v = v+1; 579 //v = v+1;
580 if (v) 580 if (v)
587 if ((char)uSoundVolumeMultiplier > 8) 587 if ((char)uSoundVolumeMultiplier > 8)
588 uSoundVolumeMultiplier = 9; 588 uSoundVolumeMultiplier = 9;
589 //v168 = 1; 589 //v168 = 1;
590 v24 = 435; 590 v24 = 435;
591 //v154 = (int)pBtn_SliderRight; 591 //v154 = (int)pBtn_SliderRight;
592 GUIWindow::Create(v24, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); 592 new OnButtonClick2(v24, 162, 0, 0, (int)pBtn_SliderRight, (char *)1);
593 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 593 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
594 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0); 594 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
595 continue; 595 continue;
596 } 596 }
597 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; 597 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
616 if (uMessageParam == 4) 616 if (uMessageParam == 4)
617 { 617 {
618 --uVoicesVolumeMultiplier; 618 --uVoicesVolumeMultiplier;
619 if ((char)uVoicesVolumeMultiplier < 1) 619 if ((char)uVoicesVolumeMultiplier < 1)
620 uVoicesVolumeMultiplier = 0; 620 uVoicesVolumeMultiplier = 0;
621 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); 621 new OnButtonClick2(243, 270, 0, 0, (int)pBtn_SliderLeft, (char *)1);
622 if (!uVoicesVolumeMultiplier) 622 if (!uVoicesVolumeMultiplier)
623 continue; 623 continue;
624 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); 624 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
625 continue; 625 continue;
626 } 626 }
627 if (uMessageParam == 5) 627 if (uMessageParam == 5)
628 { 628 {
629 ++uVoicesVolumeMultiplier; 629 ++uVoicesVolumeMultiplier;
630 if ((char)uVoicesVolumeMultiplier > 8) 630 if ((char)uVoicesVolumeMultiplier > 8)
631 uVoicesVolumeMultiplier = 9; 631 uVoicesVolumeMultiplier = 9;
632 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); 632 new OnButtonClick2(435, 270, 0, 0, (int)pBtn_SliderRight, (char *)1);
633 if (!uVoicesVolumeMultiplier) 633 if (!uVoicesVolumeMultiplier)
634 continue; 634 continue;
635 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); 635 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
636 continue; 636 continue;
637 } 637 }
685 DoThatMessageThing(); 685 DoThatMessageThing();
686 if (current_screen_type != SCREEN_GAME) 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 = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
691 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); 691 pBooksWindow = new GUIWindow_BooksWindow(493u, 355u, 0, 0, (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 != SCREEN_GAME) 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 = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
701 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); 701 pBooksWindow = new GUIWindow_BooksWindow(527u, 353u, 0, 0, (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 != SCREEN_GAME) 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 = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
713 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); 713 pBooksWindow = new GUIWindow_BooksWindow(546, 353, 0, 0, (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 != SCREEN_GAME) 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 = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
722 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); 722 pBooksWindow = new GUIWindow_BooksWindow(570, 354, 0, 0, (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 != SCREEN_GAME) 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 = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), uMessage, 0);
731 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); 731 pBooksWindow = new GUIWindow_BooksWindow(0x258u, 0x169u, 0, 0, (int)pBtn_History, 0);
732 bFlashHistoryBook = 0; 732 bFlashHistoryBook = 0;
733 continue; 733 continue;
734 case UIMSG_Escape:// нажатие Escape and return to game 734 case UIMSG_Escape:// нажатие Escape and return to game
735 back_to_game(); 735 back_to_game();
736 DoThatMessageThing(); 736 DoThatMessageThing();
1254 continue; 1254 continue;
1255 } 1255 }
1256 if (!pGUIWindow_Settings)//Draw Menu 1256 if (!pGUIWindow_Settings)//Draw Menu
1257 { 1257 {
1258 dword_6BE138 = -1; 1258 dword_6BE138 = -1;
1259 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); 1259 new OnButtonClick2(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, (char *)1);
1260 pEventTimer->Pause(); 1260 pEventTimer->Pause();
1261 pAudioPlayer->StopChannels(-1, -1); 1261 pAudioPlayer->StopChannels(-1, -1);
1262 current_screen_type = SCREEN_MENU; 1262 current_screen_type = SCREEN_MENU;
1263 1263
1264 ++pIcons_LOD->uTexturePacksCount; 1264 ++pIcons_LOD->uTexturePacksCount;
1287 continue; 1287 continue;
1288 1288
1289 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel 1289 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
1290 if (uMessageParam) 1290 if (uMessageParam)
1291 { 1291 {
1292 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); 1292 new OnButtonClick2(626, 179, 0, 0, (int)pBtn_NPCRight, 0);
1293 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;
1294 if (pParty->hirelingScrollPosition < v37) 1294 if (pParty->hirelingScrollPosition < v37)
1295 { 1295 {
1296 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell??? 1296 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
1297 if (pParty->hirelingScrollPosition >= v37) 1297 if (pParty->hirelingScrollPosition >= v37)
1298 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; 1298 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
1299 } 1299 }
1300 } 1300 }
1301 else 1301 else
1302 { 1302 {
1303 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); 1303 new OnButtonClick2(469, 179, 0, 0, (int)pBtn_NPCLeft, 0);
1304 /*if ( pParty->field_709 ) 1304 /*if ( pParty->field_709 )
1305 { 1305 {
1306 --pParty->field_709; 1306 --pParty->field_709;
1307 if ( pParty->field_709 < 1 ) 1307 if ( pParty->field_709 < 1 )
1308 pParty->field_709 = 0; 1308 pParty->field_709 = 0;
1656 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); 1656 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
1657 continue; 1657 continue;
1658 1658
1659 case UIMSG_OnCastTownPortal: 1659 case UIMSG_OnCastTownPortal:
1660 pAudioPlayer->StopChannels(-1, -1); 1660 pAudioPlayer->StopChannels(-1, -1);
1661 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); 1661 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_TownPortal, (char *)uMessageParam);
1662 continue; 1662 continue;
1663 1663
1664 case UIMSG_OnCastLloydsBeacon: 1664 case UIMSG_OnCastLloydsBeacon:
1665 pAudioPlayer->StopChannels(-1, -1); 1665 pAudioPlayer->StopChannels(-1, -1);
1666 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_LloydsBeacon, 0); 1666 pGUIWindow_CurrentMenu = new GUIWindow_Book(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_LloydsBeacon, 0);
1667 continue; 1667 continue;
1668 1668
1669 case UIMSG_LloydsBeacon_FlippingBtn: 1669 case UIMSG_LloydsBeacon_FlippingBtn:
1670 bRecallingBeacon = uMessageParam; 1670 bRecallingBeacon = uMessageParam;
1671 v127 = uMessageParam + 204; 1671 v127 = uMessageParam + 204;
2098 continue; 2098 continue;
2099 case UIMSG_1C: 2099 case UIMSG_1C:
2100 __debugbreak(); 2100 __debugbreak();
2101 if (!uActiveCharacter || current_screen_type != SCREEN_GAME) 2101 if (!uActiveCharacter || current_screen_type != SCREEN_GAME)
2102 continue; 2102 continue;
2103 ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0); 2103 __debugbreak();//ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
2104 current_screen_type = SCREEN_19; 2104 current_screen_type = SCREEN_19;
2105 pEventTimer->Pause(); 2105 pEventTimer->Pause();
2106 continue; 2106 continue;
2107 case UIMSG_STEALFROMACTOR: 2107 case UIMSG_STEALFROMACTOR:
2108 if (!uActiveCharacter) 2108 if (!uActiveCharacter)
2138 continue; 2138 continue;
2139 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS)) 2139 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS))
2140 Player::_42ECB5_PlayerAttacksActor(); 2140 Player::_42ECB5_PlayerAttacksActor();
2141 continue; 2141 continue;
2142 case UIMSG_ExitRest: 2142 case UIMSG_ExitRest:
2143 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" 2143 new OnCancel(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
2144 continue; 2144 continue;
2145 case UIMSG_Wait5Minutes: 2145 case UIMSG_Wait5Minutes:
2146 if (_506F14_resting_stage == 2) 2146 if (_506F14_resting_stage == 2)
2147 { 2147 {
2148 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2148 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2149 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); 2149 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
2150 continue; 2150 continue;
2151 } 2151 }
2152 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, 2152 new OnButtonClick2(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0,
2153 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" 2153 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2154 _506F14_resting_stage = 1; 2154 _506F14_resting_stage = 1;
2155 _506F18_num_minutes_to_sleep = 5; 2155 _506F18_num_minutes_to_sleep = 5;
2156 continue; 2156 continue;
2157 case UIMSG_Wait1Hour: 2157 case UIMSG_Wait1Hour:
2159 { 2159 {
2160 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2160 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2161 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); 2161 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
2162 continue; 2162 continue;
2163 } 2163 }
2164 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, 2164 new OnButtonClick2(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0,
2165 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" 2165 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2166 _506F14_resting_stage = 1; 2166 _506F14_resting_stage = 1;
2167 _506F18_num_minutes_to_sleep = 60; 2167 _506F18_num_minutes_to_sleep = 60;
2168 continue; 2168 continue;
2169 case UIMSG_RentRoom: 2169 case UIMSG_RentRoom:
2295 { 2295 {
2296 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2296 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2297 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); 2297 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
2298 continue; 2298 continue;
2299 } 2299 }
2300 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, 2300 new OnButtonClick2(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0,
2301 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" 2301 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
2302 v97 = _494820_training_time(pParty->uCurrentHour); 2302 v97 = _494820_training_time(pParty->uCurrentHour);
2303 _506F14_resting_stage = 1; 2303 _506F14_resting_stage = 1;
2304 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; 2304 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
2305 continue; 2305 continue;
2338 } 2338 }
2339 sprintfex(pTmpBuf.data(), v161, v178); 2339 sprintfex(pTmpBuf.data(), v161, v178);
2340 GameUI_SetFooterString(pTmpBuf.data()); 2340 GameUI_SetFooterString(pTmpBuf.data());
2341 continue; 2341 continue;
2342 case UIMSG_ClickInstallRemoveQuickSpellBtn: 2342 case UIMSG_ClickInstallRemoveQuickSpellBtn:
2343 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); 2343 new OnButtonClick2(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (int)pBtn_InstallRemoveSpell, 0);
2344 if (!uActiveCharacter) 2344 if (!uActiveCharacter)
2345 continue; 2345 continue;
2346 pPlayer10 = pPlayers[uActiveCharacter]; 2346 pPlayer10 = pPlayers[uActiveCharacter];
2347 if (!byte_506550 || !quick_spell_at_page) 2347 if (!byte_506550 || !quick_spell_at_page)
2348 { 2348 {
2465 DoThatMessageThing(); 2465 DoThatMessageThing();
2466 if (uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery) 2466 if (uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery)
2467 { 2467 {
2468 if (current_screen_type == SCREEN_GAME) 2468 if (current_screen_type == SCREEN_GAME)
2469 { 2469 {
2470 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); 2470 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2471 current_screen_type = SCREEN_SPELL_BOOK; 2471 current_screen_type = SCREEN_SPELL_BOOK;
2472 pEventTimer->Pause(); 2472 pEventTimer->Pause();
2473 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0); 2473 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2474 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0); 2474 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
2475 viewparams->field_48 = 1; 2475 viewparams->field_48 = 1;
2476 continue; 2476 continue;
2477 } 2477 }
2478 if (current_screen_type != SCREEN_REST && current_screen_type != SCREEN_CHARACTERS 2478 if (current_screen_type != SCREEN_REST && current_screen_type != SCREEN_CHARACTERS
2479 && (current_screen_type <= SCREEN_63 || current_screen_type > SCREEN_67)) 2479 && (current_screen_type <= SCREEN_63 || current_screen_type > SCREEN_67))
2480 { 2480 {
2481 pGUIWindow_CurrentMenu->Release(); 2481 pGUIWindow_CurrentMenu->Release();
2482 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); 2482 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2483 current_screen_type = SCREEN_SPELL_BOOK; 2483 current_screen_type = SCREEN_SPELL_BOOK;
2484 pEventTimer->Pause(); 2484 pEventTimer->Pause();
2485 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0); 2485 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook(0, 0, window->GetWidth(), window->GetHeight(), 0, 0);
2486 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0); 2486 pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
2487 viewparams->field_48 = 1; 2487 viewparams->field_48 = 1;
2488 continue; 2488 continue;
2489 } 2489 }
2490 } 2490 }
2495 if (current_screen_type) 2495 if (current_screen_type)
2496 pGUIWindow_CurrentMenu->Release(); 2496 pGUIWindow_CurrentMenu->Release();
2497 ++pIcons_LOD->uTexturePacksCount; 2497 ++pIcons_LOD->uTexturePacksCount;
2498 if (!pIcons_LOD->uNumPrevLoadedFiles) 2498 if (!pIcons_LOD->uNumPrevLoadedFiles)
2499 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 2499 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2500 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); 2500 new OnButtonClick2(0x230u, 0x1C2u, 0, 0, (int)pBtn_QuickReference, 0);
2501 viewparams->bRedrawGameUI = 1; 2501 viewparams->bRedrawGameUI = 1;
2502 pEventTimer->Pause(); 2502 pEventTimer->Pause();
2503 pAudioPlayer->StopChannels(-1, -1); 2503 pAudioPlayer->StopChannels(-1, -1);
2504 current_screen_type = SCREEN_QUICK_REFERENCE; 2504 current_screen_type = SCREEN_QUICK_REFERENCE;
2505 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0); 2505 pGUIWindow_CurrentMenu = new GUIWindow_QuickReference(0, 0, window->GetWidth(), window->GetHeight(), 5, 0);
2506 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); 2506 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
2507 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, 2507 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
2508 pGlobalTXT_LocalizationStrings[79],// "Exit" 2508 pGlobalTXT_LocalizationStrings[79],// "Exit"
2509 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); 2509 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
2510 continue; 2510 continue;
2519 2519
2520 stru_506E40.Release(); 2520 stru_506E40.Release();
2521 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); 2521 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
2522 stru_506E40.LoadPCXFile("gamma.pcx", 0); 2522 stru_506E40.LoadPCXFile("gamma.pcx", 0);
2523 2523
2524 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); 2524 new OnButtonClick(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, 0);
2525 //LABEL_453: 2525 //LABEL_453:
2526 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 2526 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
2527 continue; 2527 continue;
2528 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 2528 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
2529 //goto LABEL_770; 2529 //goto LABEL_770;
2536 books_page_number = 1; 2536 books_page_number = 1;
2537 if (pMouse->GetCursorPos(&v211)->y > 178) 2537 if (pMouse->GetCursorPos(&v211)->y > 178)
2538 books_page_number = -1; 2538 books_page_number = -1;
2539 continue; 2539 continue;
2540 case UIMSG_ClickAwardsUpBtn: 2540 case UIMSG_ClickAwardsUpBtn:
2541 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); 2541 new OnButtonClick3(pBtn_Up->uX, pBtn_Up->uY, 0, 0, (int)pBtn_Up, 0);
2542 BtnUp_flag = 1; 2542 BtnUp_flag = 1;
2543 continue; 2543 continue;
2544 case UIMSG_ClickAwardsDownBtn: 2544 case UIMSG_ClickAwardsDownBtn:
2545 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); 2545 new OnButtonClick3(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (int)pBtn_Down, 0);
2546 BtnDown_flag = 1; 2546 BtnDown_flag = 1;
2547 continue; 2547 continue;
2548 case UIMSG_ChangeDetaliz: 2548 case UIMSG_ChangeDetaliz:
2549 bRingsShownInCharScreen ^= 1; 2549 bRingsShownInCharScreen ^= 1;
2550 pCharacterScreen_DetalizBtn->Release(); 2550 pCharacterScreen_DetalizBtn->Release();
2571 continue; 2571 continue;
2572 case UIMSG_ClickPaperdoll: 2572 case UIMSG_ClickPaperdoll:
2573 OnPaperdollLeftClick(); 2573 OnPaperdollLeftClick();
2574 continue; 2574 continue;
2575 case UIMSG_ClickStatsBtn: 2575 case UIMSG_ClickStatsBtn:
2576 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 2576 current_character_screen_window = WINDOW_CharacterWindow_Stats;
2577 CharacterUI_ReleaseButtons(); 2577 CharacterUI_ReleaseButtons();
2578 ReleaseAwardsScrollBar(); 2578 ReleaseAwardsScrollBar();
2579 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); 2579 new OnButtonClick3(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, (int)pCharacterScreen_StatsBtn, 0);
2580 continue; 2580 continue;
2581 case UIMSG_ClickSkillsBtn: 2581 case UIMSG_ClickSkillsBtn:
2582 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; 2582 current_character_screen_window = WINDOW_CharacterWindow_Skills;
2583 CharacterUI_ReleaseButtons(); 2583 CharacterUI_ReleaseButtons();
2584 ReleaseAwardsScrollBar(); 2584 ReleaseAwardsScrollBar();
2585 CharacterUI_SkillsTab_CreateButtons(); 2585 CharacterUI_SkillsTab_CreateButtons();
2586 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); 2586 new OnButtonClick3(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, (int)pCharacterScreen_SkillsBtn, 0);
2587 continue; 2587 continue;
2588 case UIMSG_SkillUp: 2588 case UIMSG_SkillUp:
2589 pPlayer4 = pPlayers[uActiveCharacter]; 2589 pPlayer4 = pPlayers[uActiveCharacter];
2590 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; 2590 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
2591 LOWORD(v2) = *(short *)v105; 2591 LOWORD(v2) = *(short *)v105;
2607 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" 2607 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
2608 } 2608 }
2609 ShowStatusBarString(v87, 2); 2609 ShowStatusBarString(v87, 2);
2610 continue; 2610 continue;
2611 case UIMSG_ClickInventoryBtn: 2611 case UIMSG_ClickInventoryBtn:
2612 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; 2612 current_character_screen_window = WINDOW_CharacterWindow_Inventory;
2613 ReleaseAwardsScrollBar(); 2613 ReleaseAwardsScrollBar();
2614 CharacterUI_ReleaseButtons(); 2614 CharacterUI_ReleaseButtons();
2615 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); 2615 new OnButtonClick3(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, (int)pCharacterScreen_InventoryBtn, 0);
2616 continue; 2616 continue;
2617 case UIMSG_ClickExitCharacterWindowBtn: 2617 case UIMSG_ClickExitCharacterWindowBtn:
2618 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); 2618 new OnCancel2(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, (int)pCharacterScreen_ExitBtn, 0);
2619 continue; 2619 continue;
2620 case UIMSG_ClickAwardsBtn: 2620 case UIMSG_ClickAwardsBtn:
2621 ReleaseAwardsScrollBar(); 2621 ReleaseAwardsScrollBar();
2622 CharacterUI_ReleaseButtons(); 2622 CharacterUI_ReleaseButtons();
2623 CreateAwardsScrollBar(); 2623 CreateAwardsScrollBar();
2624 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; 2624 current_character_screen_window = WINDOW_CharacterWindow_Awards;
2625 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); 2625 new OnButtonClick3(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (int)pCharacterScreen_AwardsBtn, 0);
2626 FillAwardsData(); 2626 FillAwardsData();
2627 continue; 2627 continue;
2628 case UIMSG_ClickBooksBtn: 2628 case UIMSG_ClickBooksBtn:
2629 switch (uMessageParam) 2629 switch (uMessageParam)
2630 { 2630 {
2677 Autonotes_Instructors_page_flag = 1; 2677 Autonotes_Instructors_page_flag = 1;
2678 break; 2678 break;
2679 default: 2679 default:
2680 continue; 2680 continue;
2681 } 2681 }
2682 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); 2682 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton, (char *)1);
2683 continue; 2683 continue;
2684 case UIMSG_SelectCharacter: 2684 case UIMSG_SelectCharacter:
2685 DoThatMessageThing(); 2685 DoThatMessageThing();
2686 GameUI_OnPlayerPortraitLeftClick(uMessageParam); 2686 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
2687 continue; 2687 continue;
2808 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); 2808 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
2809 pPoint3 = pMouse->GetCursorPos(&v204); 2809 pPoint3 = pMouse->GetCursorPos(&v204);
2810 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; 2810 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
2811 }*/ 2811 }*/
2812 pButton2 = (GUIButton *)(unsigned __int16)v116; 2812 pButton2 = (GUIButton *)(unsigned __int16)v116;
2813 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); 2813 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
2814 continue; 2814 continue;
2815 case UIMSG_54: 2815 case UIMSG_54:
2816 __debugbreak(); 2816 __debugbreak();
2817 pButton2 = (GUIButton *)uMessageParam; 2817 pButton2 = (GUIButton *)uMessageParam;
2818 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); 2818 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
2819 continue; 2819 continue;
2820 case UIMSG_Game_Action: 2820 case UIMSG_Game_Action:
2821 DoThatMessageThing(); 2821 DoThatMessageThing();
2822 OnPressSpace(); 2822 OnPressSpace();
2823 continue; 2823 continue;
2824 case UIMSG_ClickZoomOutBtn: 2824 case UIMSG_ClickZoomOutBtn:
2825 if (current_screen_type) 2825 if (current_screen_type)
2826 continue; 2826 continue;
2827 pParty->uFlags |= 2u; 2827 pParty->uFlags |= 2u;
2828 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); 2828 new OnButtonClick2(519, 136, 0, 0, (int)pBtn_ZoomOut, 0);
2829 uNumSeconds = 131072; 2829 uNumSeconds = 131072;
2830 v118 = 2 * viewparams->uMinimapZoom; 2830 v118 = 2 * viewparams->uMinimapZoom;
2831 ++viewparams->field_28; 2831 ++viewparams->field_28;
2832 viewparams->uMinimapZoom *= 2; 2832 viewparams->uMinimapZoom *= 2;
2833 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor) 2833 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor)
2853 break; 2853 break;
2854 case UIMSG_ClickZoomInBtn: 2854 case UIMSG_ClickZoomInBtn:
2855 if (current_screen_type) 2855 if (current_screen_type)
2856 continue; 2856 continue;
2857 pParty->uFlags |= 2u; 2857 pParty->uFlags |= 2u;
2858 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); 2858 new OnButtonClick2(574, 136, 0, 0, (int)pBtn_ZoomIn, 0);
2859 uNumSeconds = 32768; 2859 uNumSeconds = 32768;
2860 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; 2860 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
2861 --viewparams->field_28; 2861 --viewparams->field_28;
2862 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; 2862 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
2863 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) 2863 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)