# HG changeset patch # User Ritor1 # Date 1367667917 -21600 # Node ID 9a5db2cf999a34df1e63323615d99d7803a24045 # Parent f8dd764fb7d7b114743f1adc0d6eb3c7c3f231fa UIMSG and WINDOW_Type diff -r f8dd764fb7d7 -r 9a5db2cf999a GUIWindow.cpp --- a/GUIWindow.cpp Fri May 03 17:38:30 2013 +0600 +++ b/GUIWindow.cpp Sat May 04 17:45:17 2013 +0600 @@ -359,7 +359,7 @@ } case WINDOW_Book: { - OnCloseSpellook(); + OnCloseSpellBook(); break; } case WINDOW_ChangeLocation: @@ -976,8 +976,8 @@ if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); - CreateButton(476, 450, pTexture_506444->uTextureWidth, pTexture_506444->uTextureHeight, 1, 78, UIMSG_58, 0, 0, "", 0); - pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_58, 0, 0, "", pTexture_506444, 0); + CreateButton(476, 450, pTexture_506444->uTextureWidth, pTexture_506444->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); + pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pTexture_506444, 0); CreateButton(561, 450, ptr_506440->uTextureWidth, ptr_506440->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], ptr_506440, 0); } @@ -1937,7 +1937,7 @@ { pMainScreenNum = pCurrentScreen; pCurrentScreen = SCREEN_INPUT_BLV; - pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_19C, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Отмена + pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Отмена pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); diff -r f8dd764fb7d7 -r 9a5db2cf999a GUIWindow.h --- a/GUIWindow.h Fri May 03 17:38:30 2013 +0600 +++ b/GUIWindow.h Sat May 04 17:45:17 2013 +0600 @@ -12,7 +12,7 @@ UIMSG_ChangeGameState = 5, - UIMSG_A = 10, + UIMSG_MouseLeftClickInGame = 10, UIMSG_C = 12, @@ -57,7 +57,7 @@ UIMSG_PlayerCreationRemoveUpSkill = 74, UIMSG_PlayerCreationRemoveDownSkill = 75, - UIMSG_4E = 78, + UIMSG_HintSelectRemoveQuickSpellBtn = 78, UIMSG_SPellbook_ShowHightlightedSpellInfo = 79, UIMSG_BuyInShop_Identify_Repair = 81, @@ -67,7 +67,7 @@ UIMSG_ChangeDetaliz = 85, UIMSG_SelectSpell = 86, UIMSG_OpenSpellbookPage = 87, - UIMSG_58 = 88, + UIMSG_ClickInstallRemoveQuickSpellBtn = 88, UIMSG_OnTravelByFoot = 90, UIMSG_5B = 91, @@ -91,10 +91,10 @@ UIMSG_ChangeSoundVolume = 111, UIMSG_ChangeMusicVolume = 112, UIMSG_Escape = 113, - UIMSG_72 = 114, - UIMSG_73 = 115, - UIMSG_74 = 116, - UIMSG_75 = 117, + UIMSG_ClickSkillsBtn = 114, + UIMSG_ClickStatsBtn = 115, + UIMSG_ClickInventoryBtn = 116, + UIMSG_ClickAwardsBtn = 117, UIMSG_PlayerCreation_SelectAttribute = 118, UIMSG_InventoryLeftClick = 120, @@ -129,7 +129,7 @@ UIMSG_SelectLoadSlot = 165, UIMSG_Cancel = 166, UIMSG_ExitRest = 167, - UIMSG_A8 = 168, + UIMSG_ClickExitCharacterWindowBtn = 168, UIMSG_A9 = 169, UIMSG_AA = 170, UIMSG_PlayerCreation_FacePrev = 171, @@ -184,8 +184,8 @@ UIMSG_ToggleAlwaysRun = 225, UIMSG_ToggleFlipOnExit = 226, - UIMSG_16F = 367, - UIMSG_170 = 368, + UIMSG_ClickZoomOutBtn = 367, + UIMSG_ClickZoomInBtn = 368, UIMSG_Game_Action = 404, UIMSG_SelectShopDialogueOption = 405, @@ -193,7 +193,7 @@ UIMSG_RentRoom = 409, UIMSG_19A = 410, UIMSG_TransitionUI_Confirm = 411, - UIMSG_19C = 412, + UIMSG_TransitionWindowCloseBtn = 412, UIMSG_OpenKeyMappingOptions = 415, UIMSG_SelectKeyPage1 = 416, @@ -262,6 +262,7 @@ WINDOW_Book = 0x9, WINDOW_Dialogue = 10, WINDOW_QuickReference = 12, + WINDOW_F = 15, WINDOW_Rest = 16, WINDOW_ChangeLocation = 17, WINDOW_SpellBook = 0x12, @@ -271,7 +272,7 @@ WINDOW_MainMenu_Load = 0x18, WINDOW_HouseInterior = 0x19, WINDOW_Transition = 26, - WINDOW_1B = 0x1B, + WINDOW_1B = 27, WINDOW_Scroll = 0x1E, WINDOW_CastSpell_InInventory = 31, WINDOW_FinalWindow = 0x46, @@ -279,14 +280,14 @@ WINDOW_59 = 0x59, WINDOW_5A = 90, WINDOW_5B = 91, - WINDOW_VoiceSwitcherButton = 0x5C, + WINDOW_VoiceSwitcherButton = 92, WINDOW_5D = 0x5D, WINDOW_5E = 94, - WINDOW_5F = 0x5F, + WINDOW_LoadGame_CancelBtn = 0x5F, WINDOW_ExitRestWindow = 96, - WINDOW_ExitCharacterWindow = 0x61, + WINDOW_ExitCharacterWindow = 97, WINDOW_RestWindow = 0x62, - WINDOW_63 = 99, + WINDOW_BooksWindow = 99, WINDOW_CharacterWindow_Stats = 0x64, WINDOW_CharacterWindow_Skills = 0x65, WINDOW_CharacterWindow_Awards = 0x66, diff -r f8dd764fb7d7 -r 9a5db2cf999a UIBooks.cpp --- a/UIBooks.cpp Fri May 03 17:38:30 2013 +0600 +++ b/UIBooks.cpp Sat May 04 17:45:17 2013 +0600 @@ -137,7 +137,7 @@ //----- (00411597) -------------------------------------------------------- -void __cdecl OnCloseSpellook() +void __cdecl OnCloseSpellBook() { pAllocator->FreeChunk(pSpellFont); pSpellFont = 0; diff -r f8dd764fb7d7 -r 9a5db2cf999a UIMainMenu.cpp --- a/UIMainMenu.cpp Fri May 03 17:38:30 2013 +0600 +++ b/UIMainMenu.cpp Sat May 04 17:45:17 2013 +0600 @@ -151,7 +151,7 @@ uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); - pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, UIMSG_A, 0, 0, "", 0); + pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0); pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); @@ -200,11 +200,11 @@ v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); - pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, UIMSG_170, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In + pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, UIMSG_ClickZoomInBtn, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In v24, 0); v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); - pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, UIMSG_16F, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out + pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, UIMSG_ClickZoomOutBtn, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out v29, 0); pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, UIMSG_0, 0, 0, "", 0); pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, UIMSG_StartHireling1Dialogue, 0, '5', "", 0); diff -r f8dd764fb7d7 -r 9a5db2cf999a UIRest.cpp --- a/UIRest.cpp Fri May 03 17:38:30 2013 +0600 +++ b/UIRest.cpp Sat May 04 17:45:17 2013 +0600 @@ -60,7 +60,7 @@ } pEventTimer->Pause(); if ( dword_506F14 != 2 ) - GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); + GUIWindow::Create(518u, 450u, 0, 0, WINDOW_5A, (int)pBtn_Rest, 0); _506F18_num_hours_to_sleep = 0; dword_506F14 = 0; uRestUI_FoodRequiredToRest = 2; @@ -195,11 +195,7 @@ Dst.pParent = 0; sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - pButton_RestUI_WaitUntilDawn->DrawLabel( - pGlobalTXT_LocalizationStrings[237], - pFontCreate, - a5, - *(int **)a9); + pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, a5, *(int **)a9); pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); @@ -226,14 +222,8 @@ Sleep6Hours(); } else - { - GUIWindow::Create( - pButton_RestUI_Exit->uX, - pButton_RestUI_Exit->uY, - 0, - 0, - (enum WindowType)96, - (int)pButton_RestUI_Exit, - (int)pGlobalTXT_LocalizationStrings[81]); - } + { + GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_ExitRestWindow, + (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]); + } } \ No newline at end of file diff -r f8dd764fb7d7 -r 9a5db2cf999a UiGame.cpp --- a/UiGame.cpp Fri May 03 17:38:30 2013 +0600 +++ b/UiGame.cpp Sat May 04 17:45:17 2013 +0600 @@ -1231,31 +1231,31 @@ pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, - 1, 0, UIMSG_73, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats + 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats pIcons_LOD->GetTexture(papredoll_dbrds[10]), pIcons_LOD->GetTexture(papredoll_dbrds[9]), 0); pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureWidth, pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureHeight, - 1, 0, UIMSG_72, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills + 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills pIcons_LOD->GetTexture(papredoll_dbrds[8]), pIcons_LOD->GetTexture(papredoll_dbrds[7]), 0); pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureWidth, pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureHeight, - 1, 0, UIMSG_74, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory + 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory pIcons_LOD->GetTexture(papredoll_dbrds[6]), pIcons_LOD->GetTexture(papredoll_dbrds[5]), 0); pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureWidth, pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureHeight, - 1, 0, UIMSG_75, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards + 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards pIcons_LOD->GetTexture(papredoll_dbrds[4]), pIcons_LOD->GetTexture(papredoll_dbrds[3]), 0); pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureWidth, pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureHeight, - 1, 0, UIMSG_A8, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit + 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit pIcons_LOD->GetTexture(papredoll_dbrds[2]), pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); diff -r f8dd764fb7d7 -r 9a5db2cf999a mm7_1.cpp --- a/mm7_1.cpp Fri May 03 17:38:30 2013 +0600 +++ b/mm7_1.cpp Sat May 04 17:45:17 2013 +0600 @@ -692,7 +692,7 @@ CharacterUI_LoadPaperdollTextures(); pCurrentScreen = SCREEN_CASTING; v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell_InInventory, v1, 0); - pCharacterScreen_ExitBtn = v2->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_A8, 0, 0, + pCharacterScreen_ExitBtn = v2->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79], // Close pIcons_LOD->GetTexture(papredoll_dbrds[2]), pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); diff -r f8dd764fb7d7 -r 9a5db2cf999a mm7_3.cpp --- a/mm7_3.cpp Fri May 03 17:38:30 2013 +0600 +++ b/mm7_3.cpp Sat May 04 17:45:17 2013 +0600 @@ -12928,7 +12928,7 @@ } //----- (0044603D) -------------------------------------------------------- -void __cdecl sub_44603D() +void __cdecl DialogueEnding() { sDialogue_SpeakingActorNPC_ID = 0; pDialogueWindow->Release(); diff -r f8dd764fb7d7 -r 9a5db2cf999a mm7_5.cpp --- a/mm7_5.cpp Fri May 03 17:38:30 2013 +0600 +++ b/mm7_5.cpp Sat May 04 17:45:17 2013 +0600 @@ -438,7 +438,6 @@ stru_506E40.Release(); continue; case UIMSG_80: - __debugbreak; pIcons_LOD->_40F9C5(); pIcons_LOD->_4114F2(); pGUIWindow_CurrentMenu->Release(); @@ -923,7 +922,7 @@ pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); - pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_63, (int)pBtn_Quests, 0); + pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); bFlashQuestBook = 0; continue; case UIMSG_OpenAutonotes: @@ -934,7 +933,7 @@ pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); - pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_63, (int)pBtn_Autonotes, 0); + pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); bFlashAutonotesBook = 0; continue; case UIMSG_OpenMapBook: @@ -946,8 +945,8 @@ viewparams->sViewCenterX = pParty->vPosition.x; viewparams->sViewCenterY = pParty->vPosition.y; pAudioPlayer->StopChannels(-1, -1); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); - pBooksWindow = GUIWindow::Create(546, 353, 0, 0, (enum WindowType)99, (int)pBtn_Maps, 0); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); + pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); continue; case UIMSG_OpenCalendar: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -957,7 +956,7 @@ pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); - pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_63, (int)pBtn_Calendar, 0); + pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); continue; case UIMSG_OpenHistoryBook: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -967,7 +966,7 @@ pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); - pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_63, (int)pBtn_History, 0); + pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); bFlashHistoryBook = 0; continue; case UIMSG_Escape:// нажатие Escape and return to game @@ -1284,7 +1283,6 @@ pIcons_LOD->_4355F7(); continue; case SCREEN_E: - __debugbreak; pGUIWindow_CurrentMenu->Release(); pCurrentScreen = SCREEN_HOUSE; pIcons_LOD->_4114F2(); @@ -1553,7 +1551,7 @@ sub_42FBDD(); PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); pVideoPlayer->Unload(); - sub_44603D(); + DialogueEnding(); viewparams->bRedrawGameUI = v0; if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) { @@ -1607,10 +1605,10 @@ if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) pParty->uTimePlayed += 1474560i64; continue; - case UIMSG_19C: + case UIMSG_TransitionWindowCloseBtn: CloseWindowBackground(); pVideoPlayer->Unload(); - sub_44603D(); + DialogueEnding(); start_event_seq_number = 0; viewparams->bRedrawGameUI = v0; continue; @@ -1641,7 +1639,7 @@ if ( pParty->vPosition.y > 22528 ) pParty->vPosition.y = 22528; LABEL_317: - sub_44603D(); + DialogueEnding(); pCurrentScreen = SCREEN_GAME; } else @@ -1649,7 +1647,7 @@ pParty->field_6E4 = 0; pParty->field_6E0 = 0; pCastSpellInfo->_427D48(v0); - sub_44603D(); + DialogueEnding(); pEventTimer->Pause(); pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); ++pGameLoadingUI_ProgressBar->uProgressMax; @@ -1911,7 +1909,6 @@ continue; case UIMSG_B2: - __debugbreak;//UIMSG_B2 -??? bRecallingBeacon = uMessageParam; v127 = uMessageParam + 204; pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); @@ -1946,7 +1943,6 @@ sub_41C0B8_set_status_string(pTmpBuf); continue; case UIMSG_B5: - __debugbreak;//UIMSG_B5 - ??? dword_50CDC8 = v0; //goto LABEL_453; pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); @@ -2239,7 +2235,6 @@ strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); goto LABEL_524; case UIMSG_DD: - __debugbreak; LABEL_524: sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); @@ -2480,7 +2475,7 @@ _42ECB5_PlayerAttacksActor(); continue; case UIMSG_ExitRest: - GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, (WindowType)96, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" + GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_ExitRestWindow, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" continue; case UIMSG_Wait5Minutes: if ( dword_506F14 == 2 ) @@ -2653,8 +2648,7 @@ dword_506F14 = v0; _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; continue; - case UIMSG_4E: - __debugbreak;//UIMSG_4E -??? + case UIMSG_HintSelectRemoveQuickSpellBtn: if ( quick_spell_at_page && byte_506550 ) { v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; @@ -2691,8 +2685,7 @@ sub_41C0B8_set_status_string(pTmpBuf); v0 = 1; continue; - case UIMSG_58: - __debugbreak;//UIMSG_58 - ??? + case UIMSG_ClickInstallRemoveQuickSpellBtn: GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_5A, (int)pBtn_InstallRemoveSpell, 0); if ( !uActiveCharacter ) continue; @@ -2712,7 +2705,6 @@ byte_506550 = 0; continue; case UIMSG_33: - __debugbreak;//UIMSG_33 - ??? if ( !uActiveCharacter ) continue; pPlayer3 = pPlayers[uActiveCharacter]; @@ -2810,7 +2802,6 @@ continue; case UIMSG_92: - __debugbreak;//UIMSG_92 - ??? if ( pTurnEngine->field_4 != 3 ) _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, v0, 0); continue; @@ -2889,7 +2880,6 @@ free((void *)uNumSeconds); stru_506E40._40E55E("gamma.pcx", 0); GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); - uNumVisibleWindows = uNumVisibleWindows - 1; //Ritor1: Insert //LABEL_453: /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) continue; @@ -2901,18 +2891,15 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); continue; case UIMSG_C0: - __debugbreak;//UIMSG_C0 - ??? dword_50651C = v0; if ( pMouse->GetCursorPos(&v211)->y > 178 ) dword_50651C = -1; continue; case UIMSG_A9: - __debugbreak; GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_5B, (int)pBtn_Up, 0); dword_506548 = v0; continue; case UIMSG_AA: - __debugbreak; GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_5B, (int)pBtn_Down, 0); dword_506544 = v0; continue; @@ -2943,20 +2930,18 @@ case UIMSG_ClickPaperdoll: OnPaperdollLeftClick(); continue; - case UIMSG_73: - __debugbreak; + case UIMSG_ClickStatsBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; sub_4196A0(); sub_419379(); - GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_StatsBtn, 0); - continue; - case UIMSG_72: - __debugbreak; + GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_StatsBtn, 0); + continue; + case UIMSG_ClickSkillsBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; sub_4196A0(); sub_419379(); CharacterUI_SkillScreen_Draw(); - GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_SkillsBtn, 0); + GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_SkillsBtn, 0); continue; case UIMSG_SkillUp: pPlayer4 = pPlayers[uActiveCharacter]; @@ -2981,25 +2966,21 @@ } ShowStatusBarString(v87, 2); continue; - case UIMSG_74: - __debugbreak; + case UIMSG_ClickInventoryBtn: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; sub_419379(); sub_4196A0(); - GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_InventoryBtn, 0); - continue; - case UIMSG_A8: - __debugbreak; - GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, (WindowType)97, (int)pCharacterScreen_ExitBtn, 0); - continue; - case UIMSG_75: - __debugbreak; + GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_InventoryBtn, 0); + continue; + case UIMSG_ClickExitCharacterWindowBtn: + GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); + continue; + case UIMSG_ClickAwardsBtn: sub_419379(); sub_4196A0(); sub_419220(); pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; - GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), - (int)pCharacterScreen_AwardsBtn, 0); + GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_AwardsBtn, 0); FillAwardsData(); continue; case UIMSG_AutonotesBook: @@ -3054,7 +3035,7 @@ dword_50652C = v0; break; } - GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (WindowType)92, (int)pButton, v0); + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, v0); continue; case UIMSG_SelectCharacter: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -3110,7 +3091,6 @@ sub_41C0B8_set_status_string(pTmpBuf); continue; case UIMSG_C: - __debugbreak; if ( pCurrentScreen == SCREEN_F ) { sub_421EA6_OnInventoryLeftClick(); @@ -3121,8 +3101,7 @@ case UIMSG_InventoryLeftClick: sub_421EA6_OnInventoryLeftClick(); continue; - case UIMSG_A: - __debugbreak; + case UIMSG_MouseLeftClickInGame: if ( !pRenderer->pRenderD3D ) { if ( pMessageQueue_50CBD0->uNumMessages ) @@ -3172,14 +3151,12 @@ continue; }*/ continue; - case UIMSG_E: - __debugbreak; + case UIMSG_E://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; OnGameViewportClick(); continue; case UIMSG_F: - __debugbreak; if ( pRenderer->pRenderD3D ) { LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); @@ -3191,10 +3168,9 @@ v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; } pButton2 = (GUIButton *)(unsigned __int16)v116; - GUIWindow::Create(0, 0, 0, 0, (WindowType)15, (int)pButton2, 0); + GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); continue; case UIMSG_54: - __debugbreak; pButton2 = (GUIButton *)uMessageParam; GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); continue; @@ -3203,12 +3179,11 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; OnPressSpace(); continue; - case UIMSG_16F: - __debugbreak; + case UIMSG_ClickZoomOutBtn: if ( pCurrentScreen ) continue; pParty->uFlags |= 2u; - GUIWindow::Create(0x207u, 0x88u, 0, 0, (enum WindowType)90, (int)pBtn_ZoomOut, 0); + GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_5A, (int)pBtn_ZoomOut, 0); uNumSeconds = 131072; v118 = 2 * viewparams->uMinimapZoom; ++viewparams->field_28; @@ -3224,15 +3199,21 @@ } v119 = 2048; if ( (signed int)v118 <= 2048 ) - goto LABEL_789; + { + dword_576E2C = v118; + dword_576E28 = viewparams->field_28; + break; + } viewparams->field_28 = 11; - goto LABEL_788; - case UIMSG_170: - __debugbreak; + viewparams->uMinimapZoom = v119; + dword_576E2C = v119; + dword_576E28 = viewparams->field_28; + break; + case UIMSG_ClickZoomInBtn: if ( pCurrentScreen ) continue; pParty->uFlags |= 2u; - GUIWindow::Create(0x23Eu, 0x88u, 0, 0, (enum WindowType)90, (int)pBtn_ZoomIn, 0); + GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_5A, (int)pBtn_ZoomIn, 0); uNumSeconds = 32768; v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; --viewparams->field_28; @@ -3243,11 +3224,9 @@ if ( (signed int)v118 < 512 ) { viewparams->field_28 = 9; -LABEL_788: v118 = v119; viewparams->uMinimapZoom = v119; } -LABEL_789: dword_576E2C = v118; dword_576E28 = viewparams->field_28; } @@ -3366,146 +3345,170 @@ if ( pMessageQueue_50CBD0->uNumMessages ) { - //v0 = pAudioPlayer; - //pPlayer1 = pParty->pPlayers; pPlayer = pParty->pPlayers; do { int param2; pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, ¶m2); + auto player = &pParty->pPlayers[uNum]; + auto sex = player->GetSexByVoice(); switch (pUIMessageType) // For buttons of window MainMenu { case UIMSG_MainMenu_ShowPartyCreationWnd: - { GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); SetCurrentMenuID(MENU_NEWGAME); - } - continue; + break; case UIMSG_MainMenu_ShowLoadWindow: - { GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); SetCurrentMenuID(MENU_SAVELOAD); - } - continue; + break; case UIMSG_ShowCredits: - { GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); SetCurrentMenuID(MENU_CREDITS); - } - continue; + break; case UIMSG_ExitToWindows: - { GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); SetCurrentMenuID(MENU_FINISHED); - } - continue; - } - - - switch (pUIMessageType) // For buttons of Party Creation Window - { + break; case UIMSG_PlayerCreation_SelectAttribute: - { - pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) - % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; - uPlayerCreationUI_SelectedCharacter = uNum; - pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); - } - continue; - + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) + % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; + uPlayerCreationUI_SelectedCharacter = uNum; + pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); + break; case UIMSG_PlayerCreation_VoicePrev: - { - auto player = &pParty->pPlayers[uNum]; - auto sex = player->GetSexByVoice(); - do - { - if (player->uVoiceID == 0) - player->uVoiceID = 19; - else --player->uVoiceID; - } - while (player->GetSexByVoice() != sex); - - pButton = pCreationUI_BtnPressLeft2[uNum]; - GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); - pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); - player->PlaySound(SPEECH_PickMe, 0); - } - continue; - + do + { + if (player->uVoiceID == 0) + player->uVoiceID = 19; + else --player->uVoiceID; + } + while (player->GetSexByVoice() != sex); + pButton = pCreationUI_BtnPressLeft2[uNum]; + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); + pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); + player->PlaySound(SPEECH_PickMe, 0); + break; case UIMSG_PlayerCreation_VoiceNext: - { - auto player = &pParty->pPlayers[uNum]; - auto sex = player->GetSexByVoice(); + { + //auto player = &pParty->pPlayers[uNum]; + //auto sex = player->GetSexByVoice(); do { player->uVoiceID = (player->uVoiceID + 1) % 20; } while (player->GetSexByVoice() != sex); - pButton = pCreationUI_BtnPressRight2[uNum]; GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); player->PlaySound(SPEECH_PickMe, 0); - } - continue; - + break; + } case UIMSG_PlayerCreation_FacePrev: - { - pPlayer = &pParty->pPlayers[uNum]; - if (!pPlayer->uFace) - pPlayer->uFace = 19; - else - pPlayer->uFace -= 1; - pPlayer->uVoiceID = pPlayer->uFace; - pPlayer->SetInitialStats(); - pPlayer->SetSexByVoice(); - pPlayer->RandomizeName(); - v25 = uNum; - pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) - % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; - uPlayerCreationUI_SelectedCharacter = v25; - GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1); - //v0 = pAudioPlayer; - pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); - pPlayer->PlaySound(SPEECH_PickMe, 0); - //v1 = (char *)pParty->pPlayers; - } - continue; - + pPlayer = &pParty->pPlayers[uNum]; + if (!pPlayer->uFace) + pPlayer->uFace = 19; + else + pPlayer->uFace -= 1; + pPlayer->uVoiceID = pPlayer->uFace; + pPlayer->SetInitialStats(); + pPlayer->SetSexByVoice(); + pPlayer->RandomizeName(); + v25 = uNum; + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) + % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; + uPlayerCreationUI_SelectedCharacter = v25; + GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1); + //v0 = pAudioPlayer; + pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); + pPlayer->PlaySound(SPEECH_PickMe, 0); + //v1 = (char *)pParty->pPlayers; + break; case UIMSG_PlayerCreation_FaceNext: - { - pPlayer = &pParty->pPlayers[uNum]; - v20 = (char)((int)pPlayer->uFace + 1) % 20; - pPlayer->uFace = v20; - pPlayer->uVoiceID = v20; - pPlayer->SetInitialStats(); - pPlayer->SetSexByVoice(); - pPlayer->RandomizeName(); - v21 = uNum; - pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) - % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; - uPlayerCreationUI_SelectedCharacter = v21; - GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1); - //v0 = pAudioPlayer; - pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); - pPlayer->PlaySound(SPEECH_PickMe, 0); - //v1 = (char *)pParty->pPlayers; - } - continue; - } - - switch (pUIMessageType) // For buttons of window LoadGame - { + pPlayer = &pParty->pPlayers[uNum]; + v20 = (char)((int)pPlayer->uFace + 1) % 20; + pPlayer->uFace = v20; + pPlayer->uVoiceID = v20; + pPlayer->SetInitialStats(); + pPlayer->SetSexByVoice(); + pPlayer->RandomizeName(); + v21 = uNum; + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) + % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; + uPlayerCreationUI_SelectedCharacter = v21; + GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1); + //v0 = pAudioPlayer; + pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); + pPlayer->PlaySound(SPEECH_PickMe, 0); + //v1 = (char *)pParty->pPlayers; + break; + case UIMSG_PlayerCreationClickPlus: + GUIWindow::Create(613, 393, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnPlus, 1); + pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); + pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); + break; + case UIMSG_PlayerCreationClickMinus: + GUIWindow::Create(523, 393, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnMinus, 1); + pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); + pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); + break; + case UIMSG_PlayerCreationSelectActiveSkill: + { + auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; + v6 = _t->GetSkillIdxByOrder(uNum + 4); + if ( _t->GetSkillIdxByOrder(3) == 37 ) + pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; + pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); + break; + } + case UIMSG_PlayerCreationSelectClass: + pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); + pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); + break; + case UIMSG_PlayerCreationClickOK: + GUIWindow::Create(580, 431, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnOK, 0); + if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) + GameUI_Footer_TimeLeft = GetTickCount() + 4000; + else + uGameState = 6; + break; + case UIMSG_PlayerCreationClickReset: + GUIWindow::Create(527, 431, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnReset, 0); + pParty->Reset(); + break; + case UIMSG_PlayerCreationRemoveUpSkill: + uPlayerCreationUI_SelectedCharacter = uNum; + v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; + //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; + v41 = 2; + v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; + pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) + + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; + break; + case UIMSG_PlayerCreationChangeName: + pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); + v3 = (void *)uNum; + uPlayerCreationUI_SelectedCharacter = uNum; + pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); + pGUIWindow_CurrentMenu->ptr_1C = v3; + break; + case UIMSG_ChangeGameState: + uGameState = 1; + break; + case UIMSG_11: + pMouse->SetCursorBitmap("MICON2"); + break; + case UIMSG_3A: + SetCurrentMenuID(MENU_10); + break; case UIMSG_LoadGame: - { if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) - continue; + break; SetCurrentMenuID(MENU_LOADINGPROC); - continue; - } + break; case UIMSG_SelectLoadSlot: - { //main menu save/load wnd clicking on savegame lines if (pGUIWindow_CurrentMenu->field_40 == 1) pKeyActionMap->_459ED1(0); @@ -3528,89 +3531,45 @@ strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); } - continue; - } + break; case UIMSG_LoadSlot: - { GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0); - continue; - } + break; case UIMSG_DownArrow: - { ++pSaveListPosition; if ( pSaveListPosition >= uNum ) pSaveListPosition = uNum - 1; if ( pSaveListPosition < 1 ) pSaveListPosition = 0; pWindow = pGUIWindow_CurrentMenu; - GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0); - continue; - } + GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_5A, (int)pBtnDownArrow, 0); + break; case UIMSG_Cancel: - { - GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0); - continue; - } + GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); + break; case UIMSG_ArrowUp: - { --pSaveListPosition; if ( pSaveListPosition < 0 ) pSaveListPosition = 0; pWindow = pGUIWindow_CurrentMenu; - GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0); - continue; - } - } - - if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation - { - if ( pUIMessageType > UIMSG_DownArrow ) - { - if ( pUIMessageType == UIMSG_AD )//unknow - { - __debugbreak(); - GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); - SetCurrentMenuID(MENU_LOADINGPROC); - continue; - } - if ( pUIMessageType != UIMSG_AE )//unknow - { - __debugbreak(); - continue; - } - GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); + GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_5A, (int)pBtnArrowUp, 0); + break; + case UIMSG_AD: + GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); + SetCurrentMenuID(MENU_LOADINGPROC); + break; + case UIMSG_AE: + GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); SetCurrentMenuID(MENU_10); - continue; - } - if ( pUIMessageType == UIMSG_GameMenuButton )//unknow - { - __debugbreak(); - if ( pCurrentScreen ) - { - pGUIWindow_CurrentMenu->Release(); - pEventTimer->Resume(); - pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; - } - GUIWindow::Create(602, 450, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) - continue; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages;*/ - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); - continue; - } - if ( pUIMessageType == UIMSG_Escape ) - { + break; + case UIMSG_Escape: if ( ptr_507BDC ) { sub_41426F(); - continue; + break; } if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) - continue; + break; v15 = 1; pVideoPlayer->bStopBeforeSchedule = 1; viewparams->bRedrawGameUI = 1; @@ -3623,12 +3582,12 @@ if (GetCurrentMenuID() == MENU_NAMEPANELESC) { SetCurrentMenuID(MENU_CREATEPARTY); - continue; + break; } if (GetCurrentMenuID() == MENU_CREDITSPROC) { SetCurrentMenuID(MENU_CREDITSCLOSE); - continue; + break; } /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { @@ -3640,7 +3599,7 @@ continue; }*/ pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); - continue; + break; } v16 = GetCurrentMenuID() == 8; if ( v16 && !pCurrentScreen ) @@ -3660,7 +3619,7 @@ pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; viewparams->bRedrawGameUI = v15; - continue; + break; } if ( pCurrentScreen == SCREEN_VIDEO ) { @@ -3677,16 +3636,12 @@ pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; viewparams->bRedrawGameUI = v15; - continue; + break; } //VideoPlayer::dtor(); } - } - } - else - { - if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) - { + break; + case UIMSG_PlayerCreationRemoveDownSkill: uPlayerCreationUI_SelectedCharacter = uNum; //v41 = 3; //v1 = (char *)pParty->pPlayers; @@ -3694,93 +3649,9 @@ + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; - continue; - } - if ( (signed int)pUIMessageType > UIMSG_PlayerCreationChangeName ) - { - if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) - { - GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); - pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); - pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); - continue; - } - if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) - { - GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); - pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); - pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); - continue; - } - if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) - { - auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; - v6 = _t->GetSkillIdxByOrder(uNum + 4); - if ( _t->GetSkillIdxByOrder(3) == 37 ) - pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; - pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); - continue; - } - if ( pUIMessageType == UIMSG_PlayerCreationSelectClass ) - { - pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); - pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); - continue; - } - if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) - { - GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); - if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) - GameUI_Footer_TimeLeft = GetTickCount() + 4000; - else - uGameState = 6; - continue; - } - if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) - { - GUIWindow::Create(527, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); - pParty->Reset(); - } - else - { - if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) - { - uPlayerCreationUI_SelectedCharacter = uNum; - v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; - int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; - v41 = 2; - v5 = v4 % 7 + pSex + 7 * uNum; - pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; - pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) - + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; - continue; - } - } - } - else - { - switch ( pUIMessageType ) - { - case UIMSG_PlayerCreationChangeName: - pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); - v3 = (void *)uNum; - uPlayerCreationUI_SelectedCharacter = uNum; - pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); - pGUIWindow_CurrentMenu->ptr_1C = v3; - break; - case UIMSG_ChangeGameState: - uGameState = 1; - break; - case UIMSG_11://unknow - __debugbreak(); - pMouse->SetCursorBitmap("MICON2"); - break; - case UIMSG_3A://unknow - __debugbreak(); - SetCurrentMenuID(MENU_10); - break; - } - } + break; + default: + break; } } while ( pMessageQueue_50CBD0->uNumMessages ); @@ -10442,7 +10313,6 @@ break; } case WINDOW_5E: // window that initiates savegame loading - __debugbreak; { if (pWindow->Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); @@ -10540,7 +10410,6 @@ } case WINDOW_17: { - __debugbreak; sub_4606FE(); break; } @@ -10602,12 +10471,12 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); break; } - case WINDOW_63: + case WINDOW_BooksWindow: { - pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63 + pButton = (GUIButton *)pWindow->ptr_1C; pY = pWindow->uFrameY; pX = pWindow->uFrameX; - pRenderer->DrawTextureIndexed(pX, pY, pTexture); + pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]); viewparams->bRedrawGameUI = 1; break; } @@ -11648,7 +11517,7 @@ //----- (00419379) -------------------------------------------------------- void __cdecl sub_419379() { - GUIButton *i; // esi@2 + GUIButton *pButton; // esi@2 if ( dword_507CBC ) { @@ -11658,14 +11527,14 @@ pBtn_Down->Release(); pBtn_Down = 0; pBtn_Up = 0; - for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) - { - if ( i->msg == UIMSG_InventoryLeftClick ) - { - i->uX = dword_50698C; - i->uY = dword_506988; - i->uZ = dword_506984; - i->uW = dword_506980; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) + { + if ( pButton->msg == UIMSG_InventoryLeftClick ) + { + pButton->uX = dword_50698C; + pButton->uY = dword_506988; + pButton->uZ = dword_506984; + pButton->uW = dword_506980; pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0); } } diff -r f8dd764fb7d7 -r 9a5db2cf999a mm7_6.cpp --- a/mm7_6.cpp Fri May 03 17:38:30 2013 +0600 +++ b/mm7_6.cpp Sat May 04 17:45:17 2013 +0600 @@ -2246,7 +2246,7 @@ { if ( pGUIWindow_Settings ) return; - pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pCastSpellInfo[result], 0); + pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_1B, (int)&pCastSpellInfo[result], 0); pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 0, 0x31u, "", 0); pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 1u, 0x32u, "", 0); pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 2u, 0x33u, "", 0); @@ -2259,7 +2259,7 @@ if ( pGUIWindow_Settings ) return; - pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pCastSpellInfo[result], 0); + pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_1B, (int)&pCastSpellInfo[result], 0); pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_46, 0, 0, "", 0); sub_421B2C_PlaceInInventory_or_DropPickedItem(); return; @@ -2269,7 +2269,7 @@ if ( pGUIWindow_Settings ) return; - pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pCastSpellInfo[result], 0); + pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_1B, (int)&pCastSpellInfo[result], 0); pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_BE, 0, 0, "", 0); sub_421B2C_PlaceInInventory_or_DropPickedItem(); return; @@ -2291,7 +2291,7 @@ { if ( pGUIWindow_Settings ) return; - pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pCastSpellInfo[result], 0); + pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_1B, (int)&pCastSpellInfo[result], 0); pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 0, 0x31u, "", 0); pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 1, 0x32u, "", 0); pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 2, 0x33u, "", 0); @@ -2301,24 +2301,16 @@ } if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) { - pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pCastSpellInfo[result], 0); + pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_1B, (int)&pCastSpellInfo[result], 0); pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178, pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, - 1, - 0, - UIMSG_ScrollNPCPanel, 0, - 0, - "", + 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178, pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth, pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight, - 1, - 0, - UIMSG_ScrollNPCPanel, 1, - 0, - "", + 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0); pGUIWindow_Settings->CreateButton(0x1EBu, 149, 64, 74, 1, 0, UIMSG_8F, 4, 0x35u, "", 0); pGUIWindow_Settings->CreateButton(0x231u, 149, 64, 74, 1, 0, UIMSG_8F, 5, 0x36u, "", 0); diff -r f8dd764fb7d7 -r 9a5db2cf999a mm7_data.h --- a/mm7_data.h Fri May 03 17:38:30 2013 +0600 +++ b/mm7_data.h Sat May 04 17:45:17 2013 +0600 @@ -1557,7 +1557,7 @@ void LoadSpellbook(unsigned int uID); // idb struct GUIWindow *__cdecl sub_41140B(); void __cdecl sub_411473(); -void __cdecl OnCloseSpellook(); +void __cdecl OnCloseSpellBook(); void __cdecl InitializeBookTextures(); void __cdecl InitializeBookFonts(); void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer); @@ -1743,7 +1743,7 @@ struct NPCData *__fastcall GetNPCData(signed int npcid); struct NPCData *__fastcall GetNewNPCData(signed int npcid, int a2); int __fastcall GetGreetType(signed int SpeakingNPC_ID); -void __cdecl sub_44603D(); +void __cdecl DialogueEnding(); void PrepareHouse(enum HOUSE_ID house); // idb bool EnterHouse(enum HOUSE_ID uHouseID); int sub_4465DF_check_season(int a1);