Mercurial > mm7
comparison mm7_5.cpp @ 987:9e132060ada3
UIMSG_CHEST_ClickItem
author | Ritor1 |
---|---|
date | Sun, 12 May 2013 18:11:21 +0600 |
parents | d982fffb8b96 |
children | 087a9af8e0ec |
comparison
equal
deleted
inserted
replaced
986:b584c743cb47 | 987:9e132060ada3 |
---|---|
436 dword_6BE138 = 132; | 436 dword_6BE138 = 132; |
437 } | 437 } |
438 stru_506E40.Release(); | 438 stru_506E40.Release(); |
439 continue; | 439 continue; |
440 case UIMSG_80: | 440 case UIMSG_80: |
441 __debugbreak(); | |
441 pIcons_LOD->_40F9C5(); | 442 pIcons_LOD->_40F9C5(); |
442 pIcons_LOD->_4114F2(); | 443 pIcons_LOD->_4114F2(); |
443 pGUIWindow_CurrentMenu->Release(); | 444 pGUIWindow_CurrentMenu->Release(); |
444 pCurrentScreen = SCREEN_OPTIONS; | 445 pCurrentScreen = SCREEN_OPTIONS; |
445 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0); | 446 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0); |
729 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, v1, 0); | 730 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, v1, 0); |
730 } | 731 } |
731 } | 732 } |
732 continue; | 733 continue; |
733 case UIMSG_1A9: | 734 case UIMSG_1A9: |
735 __debugbreak(); | |
734 if ( uMessageParam == 4 ) | 736 if ( uMessageParam == 4 ) |
735 { | 737 { |
736 //--uGammaPos; | 738 //--uGammaPos; |
737 if ( (uGammaPos -- -1) < 0 ) | 739 if ( (uGammaPos -- -1) < 0 ) |
738 { | 740 { |
971 continue; | 973 continue; |
972 case UIMSG_Escape:// нажатие Escape and return to game | 974 case UIMSG_Escape:// нажатие Escape and return to game |
973 back_to_game(); | 975 back_to_game(); |
974 if ( pMessageQueue_50CBD0->uNumMessages ) | 976 if ( pMessageQueue_50CBD0->uNumMessages ) |
975 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 977 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
976 if ( pCurrentScreen > SCREEN_F ) | 978 if ( pCurrentScreen > SCREEN_CHEST_INVENTORY ) |
977 { | 979 { |
978 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) ) | 980 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) ) |
979 { | 981 { |
980 if ( dword_50CDC8 ) | 982 if ( dword_50CDC8 ) |
981 goto LABEL_232; | 983 goto LABEL_232; |
1102 case SCREEN_LOADGAME: | 1104 case SCREEN_LOADGAME: |
1103 pIcons_LOD->_4114F2(); | 1105 pIcons_LOD->_4114F2(); |
1104 //crt_deconstruct_ptr_6A0118(); | 1106 //crt_deconstruct_ptr_6A0118(); |
1105 stru_506E40.Release(); | 1107 stru_506E40.Release(); |
1106 break; | 1108 break; |
1107 case SCREEN_F: | 1109 case SCREEN_CHEST_INVENTORY: |
1108 pCurrentScreen = SCREEN_CHEST; | 1110 pCurrentScreen = SCREEN_CHEST; |
1109 continue; | 1111 continue; |
1110 case SCREEN_CHEST: | 1112 case SCREEN_CHEST: |
1111 pWindow2 = pChestWindow; | 1113 pWindow2 = pChestWindow; |
1112 pWindow2->Release(); | 1114 pWindow2->Release(); |
1114 pCurrentScreen = SCREEN_GAME; | 1116 pCurrentScreen = SCREEN_GAME; |
1115 viewparams->bRedrawGameUI = 1; | 1117 viewparams->bRedrawGameUI = 1; |
1116 pEventTimer->Resume(); | 1118 pEventTimer->Resume(); |
1117 continue; | 1119 continue; |
1118 case SCREEN_19: | 1120 case SCREEN_19: |
1121 __debugbreak(); | |
1119 pWindow2 = ptr_507BC8; | 1122 pWindow2 = ptr_507BC8; |
1120 pWindow2->Release(); | 1123 pWindow2->Release(); |
1121 pIcons_LOD->_4114F2(); | 1124 pIcons_LOD->_4114F2(); |
1122 pCurrentScreen = SCREEN_GAME; | 1125 pCurrentScreen = SCREEN_GAME; |
1123 viewparams->bRedrawGameUI = 1; | 1126 viewparams->bRedrawGameUI = 1; |
1124 pEventTimer->Resume(); | 1127 pEventTimer->Resume(); |
1125 continue; | 1128 continue; |
1126 case SCREEN_OPTIONS://Close | 1129 case SCREEN_OPTIONS://Close |
1127 options_menu_skin.Relaease(); | 1130 options_menu_skin.Relaease(); |
1128 | |
1129 pIcons_LOD->_40F9C5(); | 1131 pIcons_LOD->_40F9C5(); |
1130 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); | 1132 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); |
1131 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | 1133 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); |
1132 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | 1134 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); |
1133 WriteWindowsRegistryInt("WalkSound", bWalkSound); | 1135 WriteWindowsRegistryInt("WalkSound", bWalkSound); |
1135 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); | 1137 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); |
1136 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); | 1138 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
1137 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); | 1139 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); |
1138 if ( !uTurnSpeed ) | 1140 if ( !uTurnSpeed ) |
1139 { | 1141 { |
1140 //v171 = 3; | |
1141 //v30 = v171; | |
1142 //v31 = "TurnDelta"; | |
1143 WriteWindowsRegistryInt("TurnDelta", 3); | 1142 WriteWindowsRegistryInt("TurnDelta", 3); |
1144 stru_506E40.Release(); | 1143 stru_506E40.Release(); |
1145 break; | 1144 break; |
1146 } | 1145 } |
1147 if ( uTurnSpeed == 64 ) | 1146 if ( uTurnSpeed == 64 ) |
1148 { | 1147 { |
1149 //v171 = 2; | |
1150 //v30 = v171; | |
1151 //v31 = "TurnDelta"; | |
1152 WriteWindowsRegistryInt("TurnDelta", 2); | 1148 WriteWindowsRegistryInt("TurnDelta", 2); |
1153 stru_506E40.Release(); | 1149 stru_506E40.Release(); |
1154 break; | 1150 break; |
1155 } | 1151 } |
1156 if ( uTurnSpeed != 128 ) | 1152 if ( uTurnSpeed != 128 ) |
1157 { | 1153 { |
1158 stru_506E40.Release(); | 1154 stru_506E40.Release(); |
1159 break; | 1155 break; |
1160 } | 1156 } |
1161 //v30 = v0; | |
1162 //v31 = "TurnDelta"; | |
1163 WriteWindowsRegistryInt("TurnDelta", 1); | 1157 WriteWindowsRegistryInt("TurnDelta", 1); |
1164 stru_506E40.Release(); | 1158 stru_506E40.Release(); |
1165 break; | 1159 break; |
1166 case SCREEN_MENU: | 1160 case SCREEN_MENU: |
1167 pIcons_LOD->_40F9C5(); | 1161 pIcons_LOD->_40F9C5(); |
1281 pCurrentScreen = SCREEN_GAME; | 1275 pCurrentScreen = SCREEN_GAME; |
1282 viewparams->bRedrawGameUI = 1; | 1276 viewparams->bRedrawGameUI = 1; |
1283 pIcons_LOD->_4355F7(); | 1277 pIcons_LOD->_4355F7(); |
1284 continue; | 1278 continue; |
1285 case SCREEN_E: | 1279 case SCREEN_E: |
1280 __debugbreak(); | |
1286 pGUIWindow_CurrentMenu->Release(); | 1281 pGUIWindow_CurrentMenu->Release(); |
1287 pCurrentScreen = SCREEN_HOUSE; | 1282 pCurrentScreen = SCREEN_HOUSE; |
1288 pIcons_LOD->_4114F2(); | 1283 pIcons_LOD->_4114F2(); |
1289 continue; | 1284 continue; |
1290 case SCREEN_HOUSE: | 1285 case SCREEN_HOUSE: |
1329 pEventTimer->Resume(); | 1324 pEventTimer->Resume(); |
1330 pCurrentScreen = SCREEN_GAME; | 1325 pCurrentScreen = SCREEN_GAME; |
1331 viewparams->bRedrawGameUI = 1; | 1326 viewparams->bRedrawGameUI = 1; |
1332 pIcons_LOD->_4355F7(); | 1327 pIcons_LOD->_4355F7(); |
1333 continue; | 1328 continue; |
1334 case SCREEN_INPUT_BLV: | 1329 case SCREEN_INPUT_BLV://click escape |
1335 if ( uCurrentHouse_Animation == 153 ) | 1330 if ( uCurrentHouse_Animation == 153 ) |
1336 PlayHouseSound(0x99u, HouseSound_Greeting_2); | 1331 PlayHouseSound(0x99u, HouseSound_Greeting_2); |
1337 pVideoPlayer->Unload(); | 1332 pVideoPlayer->Unload(); |
1338 if ( dword_5B65CC ) | 1333 if ( dword_5B65CC ) |
1339 { | 1334 { |
1341 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | 1336 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; |
1342 Party__CountHirelings(); | 1337 Party__CountHirelings(); |
1343 viewparams->bRedrawGameUI = 1; | 1338 viewparams->bRedrawGameUI = 1; |
1344 dword_5B65CC = 0; | 1339 dword_5B65CC = 0; |
1345 } | 1340 } |
1346 goto LABEL_317; | 1341 DialogueEnding(); |
1347 case SCREEN_NPC_DIALOGUE: | 1342 pCurrentScreen = SCREEN_GAME; |
1343 viewparams->bRedrawGameUI = 1; | |
1344 continue; | |
1345 case SCREEN_NPC_DIALOGUE://click escape | |
1348 if ( dword_5B65CC ) | 1346 if ( dword_5B65CC ) |
1349 { | 1347 { |
1350 pParty->field_709 = 0; | 1348 pParty->field_709 = 0; |
1351 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | 1349 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; |
1352 Party__CountHirelings(); | 1350 Party__CountHirelings(); |
1353 viewparams->bRedrawGameUI = 1; | 1351 viewparams->bRedrawGameUI = 1; |
1354 dword_5B65CC = 0; | 1352 dword_5B65CC = 0; |
1355 } | 1353 } |
1356 goto LABEL_317; | 1354 //goto LABEL_317; |
1357 case SCREEN_BRANCHLESS_NPC_DIALOG: | 1355 DialogueEnding(); |
1356 pCurrentScreen = SCREEN_GAME; | |
1357 viewparams->bRedrawGameUI = 1; | |
1358 continue; | |
1359 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
1358 memset(GameUI_Footer_TimedString, 0, 0xC8u); | 1360 memset(GameUI_Footer_TimedString, 0, 0xC8u); |
1359 sub_4452BB(); | 1361 sub_4452BB(); |
1360 goto LABEL_317; | 1362 DialogueEnding(); |
1361 case SCREEN_CHANGE_LOCATION: | 1363 pCurrentScreen = SCREEN_GAME; |
1364 viewparams->bRedrawGameUI = 1; | |
1365 continue; | |
1366 case SCREEN_CHANGE_LOCATION://click escape | |
1362 if ( pParty->vPosition.x < -22528 ) | 1367 if ( pParty->vPosition.x < -22528 ) |
1363 pParty->vPosition.x = -22528; | 1368 pParty->vPosition.x = -22528; |
1364 if ( pParty->vPosition.x > 22528 ) | 1369 if ( pParty->vPosition.x > 22528 ) |
1365 pParty->vPosition.x = 22528; | 1370 pParty->vPosition.x = 22528; |
1366 if ( pParty->vPosition.y < -22528 ) | 1371 if ( pParty->vPosition.y < -22528 ) |
1367 pParty->vPosition.y = -22528; | 1372 pParty->vPosition.y = -22528; |
1368 if ( pParty->vPosition.y > 22528 ) | 1373 if ( pParty->vPosition.y > 22528 ) |
1369 pParty->vPosition.y = 22528; | 1374 pParty->vPosition.y = 22528; |
1370 goto LABEL_317; | 1375 DialogueEnding(); |
1376 pCurrentScreen = SCREEN_GAME; | |
1377 viewparams->bRedrawGameUI = 1; | |
1378 continue; | |
1371 case SCREEN_VIDEO: | 1379 case SCREEN_VIDEO: |
1372 pVideoPlayer->Unload(); | 1380 pVideoPlayer->Unload(); |
1373 continue; | 1381 continue; |
1374 case SCREEN_CHARACTERS: | 1382 case SCREEN_CHARACTERS: |
1375 goto LABEL_319; | 1383 goto LABEL_319; |
1626 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | 1634 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); |
1627 if ( bUnderwater != 1 && pParty->bFlying | 1635 if ( bUnderwater != 1 && pParty->bFlying |
1628 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | 1636 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) |
1629 { | 1637 { |
1630 viewparams->bRedrawGameUI = 1; | 1638 viewparams->bRedrawGameUI = 1; |
1631 LABEL_387: | |
1632 CloseWindowBackground(); | 1639 CloseWindowBackground(); |
1633 if ( pParty->vPosition.x < -22528 ) | 1640 if ( pParty->vPosition.x < -22528 ) |
1634 pParty->vPosition.x = -22528; | 1641 pParty->vPosition.x = -22528; |
1635 if ( pParty->vPosition.x > 22528 ) | 1642 if ( pParty->vPosition.x > 22528 ) |
1636 pParty->vPosition.x = 22528; | 1643 pParty->vPosition.x = 22528; |
1637 if ( pParty->vPosition.y < -22528 ) | 1644 if ( pParty->vPosition.y < -22528 ) |
1638 pParty->vPosition.y = -22528; | 1645 pParty->vPosition.y = -22528; |
1639 if ( pParty->vPosition.y > 22528 ) | 1646 if ( pParty->vPosition.y > 22528 ) |
1640 pParty->vPosition.y = 22528; | 1647 pParty->vPosition.y = 22528; |
1641 LABEL_317: | |
1642 DialogueEnding(); | 1648 DialogueEnding(); |
1643 pCurrentScreen = SCREEN_GAME; | 1649 pCurrentScreen = SCREEN_GAME; |
1644 } | 1650 } |
1645 else | 1651 else |
1646 { | 1652 { |
1699 bUnderwater = 1; | 1705 bUnderwater = 1; |
1700 pGame->uFlags2 |= 8u; | 1706 pGame->uFlags2 |= 8u; |
1701 } | 1707 } |
1702 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d47.blv") ) | 1708 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d47.blv") ) |
1703 bNoNPCHiring = 1; | 1709 bNoNPCHiring = 1; |
1704 //v0 = 1; | |
1705 PrepareToLoadODM(1u, (OutdoorCamera *)1); | 1710 PrepareToLoadODM(1u, (OutdoorCamera *)1); |
1706 pAudioPlayer->SetMapEAX(); | 1711 pAudioPlayer->SetMapEAX(); |
1707 bDialogueUI_InitializeActor_NPC_ID = 0; | 1712 bDialogueUI_InitializeActor_NPC_ID = 0; |
1708 OnMapLoad(); | 1713 OnMapLoad(); |
1709 pOutdoor->SetFog(); | 1714 pOutdoor->SetFog(); |
1716 pCurrentScreen = SCREEN_GAME; | 1721 pCurrentScreen = SCREEN_GAME; |
1717 pGameLoadingUI_ProgressBar->Release(); | 1722 pGameLoadingUI_ProgressBar->Release(); |
1718 } | 1723 } |
1719 viewparams->bRedrawGameUI = 1; | 1724 viewparams->bRedrawGameUI = 1; |
1720 continue; | 1725 continue; |
1721 case UIMSG_5B: | 1726 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: |
1722 goto LABEL_387; | 1727 CloseWindowBackground(); |
1723 case UIMSG_CastSpell_BE: | 1728 if ( pParty->vPosition.x < -22528 ) |
1729 pParty->vPosition.x = -22528; | |
1730 if ( pParty->vPosition.x > 22528 ) | |
1731 pParty->vPosition.x = 22528; | |
1732 if ( pParty->vPosition.y < -22528 ) | |
1733 pParty->vPosition.y = -22528; | |
1734 if ( pParty->vPosition.y > 22528 ) | |
1735 pParty->vPosition.y = 22528; | |
1736 DialogueEnding(); | |
1737 pCurrentScreen = SCREEN_GAME; | |
1738 viewparams->bRedrawGameUI = 1; | |
1739 continue; | |
1740 case UIMSG_CastSpell_BE://??? | |
1741 __debugbreak(); | |
1724 if ( pRenderer->pRenderD3D ) | 1742 if ( pRenderer->pRenderD3D ) |
1725 { | 1743 { |
1726 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); | 1744 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1727 } | 1745 } |
1728 else | 1746 else |
1739 { | 1757 { |
1740 v47 = pActors[v46].uAIState == Dead; | 1758 v47 = pActors[v46].uAIState == Dead; |
1741 if ( !v47 ) | 1759 if ( !v47 ) |
1742 continue; | 1760 continue; |
1743 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1761 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1744 *((char *)v51 + 8) &= 0xBFu; | 1762 LOBYTE(v51->field_8) &= 0xBFu; |
1745 *((short *)v51 + 2) = uMessageParam; | 1763 v51->uPlayerID_2 = uMessageParam; |
1746 *((int *)v51 + 3) = v44; | 1764 v51->spell_target_pid = v44; |
1747 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1765 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1748 pWindow3 = pGUIWindow_Settings; | 1766 pWindow3 = pGUIWindow_Settings; |
1749 pWindow3->Release(); | 1767 pWindow3->Release(); |
1750 pGUIWindow_Settings = 0; | 1768 pGUIWindow_Settings = 0; |
1751 pMouse->SetCursorBitmap("MICON1"); | 1769 pMouse->SetCursorBitmap("MICON1"); |
1752 GameUI_Footer_TimeLeft = 0; | 1770 GameUI_Footer_TimeLeft = 0; |
1758 { | 1776 { |
1759 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | 1777 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; |
1760 if ( !v47 ) | 1778 if ( !v47 ) |
1761 continue; | 1779 continue; |
1762 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1780 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1763 *((char *)v51 + 8) &= 0xBFu; | 1781 LOBYTE(v51->field_8) &= 0xBFu; |
1764 *((short *)v51 + 2) = uMessageParam; | 1782 v51->uPlayerID_2 = uMessageParam; |
1765 *((int *)v51 + 3) = v44; | 1783 v51->spell_target_pid = v44; |
1766 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1784 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1767 pWindow3 = pGUIWindow_Settings; | 1785 pWindow3 = pGUIWindow_Settings; |
1768 pWindow3->Release(); | 1786 pWindow3->Release(); |
1769 pGUIWindow_Settings = 0; | 1787 pGUIWindow_Settings = 0; |
1770 pMouse->SetCursorBitmap("MICON1"); | 1788 pMouse->SetCursorBitmap("MICON1"); |
1771 GameUI_Footer_TimeLeft = 0; | 1789 GameUI_Footer_TimeLeft = 0; |
1785 { | 1803 { |
1786 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | 1804 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; |
1787 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) | 1805 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) |
1788 continue; | 1806 continue; |
1789 v44 = uNumSeconds; | 1807 v44 = uNumSeconds; |
1790 //goto LABEL_415; | |
1791 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1808 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1792 *((char *)v51 + 8) &= 0xBFu; | 1809 *((char *)v51 + 8) &= 0xBFu; |
1793 *((short *)v51 + 2) = uMessageParam; | 1810 v51->uPlayerID_2 = uMessageParam; |
1794 *((int *)v51 + 3) = v44; | 1811 v51->spell_target_pid = v44; |
1795 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1812 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1796 pWindow3 = pGUIWindow_Settings; | 1813 pWindow3 = pGUIWindow_Settings; |
1797 pWindow3->Release(); | 1814 pWindow3->Release(); |
1798 pGUIWindow_Settings = 0; | 1815 pGUIWindow_Settings = 0; |
1799 pMouse->SetCursorBitmap("MICON1"); | 1816 pMouse->SetCursorBitmap("MICON1"); |
1800 GameUI_Footer_TimeLeft = 0; | 1817 GameUI_Footer_TimeLeft = 0; |
1807 continue; | 1824 continue; |
1808 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | 1825 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; |
1809 } | 1826 } |
1810 if ( v48 ) | 1827 if ( v48 ) |
1811 continue; | 1828 continue; |
1812 //LABEL_415: | |
1813 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1829 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1814 *((char *)v51 + 8) &= 0xBFu; | 1830 LOBYTE(v51->field_8) &= 0xBFu; |
1815 //LABEL_416: | 1831 v51->uPlayerID_2 = uMessageParam; |
1816 *((short *)v51 + 2) = uMessageParam; | 1832 v51->spell_target_pid = v44; |
1817 *((int *)v51 + 3) = v44; | 1833 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1818 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | |
1819 pWindow3 = pGUIWindow_Settings; | 1834 pWindow3 = pGUIWindow_Settings; |
1820 //LABEL_333: | |
1821 pWindow3->Release(); | 1835 pWindow3->Release(); |
1822 pGUIWindow_Settings = 0; | 1836 pGUIWindow_Settings = 0; |
1823 pMouse->SetCursorBitmap("MICON1"); | 1837 pMouse->SetCursorBitmap("MICON1"); |
1824 GameUI_Footer_TimeLeft = 0; | 1838 GameUI_Footer_TimeLeft = 0; |
1825 unk_50C9A0 = 0; | 1839 unk_50C9A0 = 0; |
1826 back_to_game(); | 1840 back_to_game(); |
1827 continue; | 1841 continue; |
1828 case UIMSG_CastSpell_SPIRIT_Preservation: | 1842 case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade) |
1829 case UIMSG_CastSpell_8D: | 1843 case UIMSG_CastSpell_SPIRIT_Fate: |
1830 case UIMSG_8F: | 1844 case UIMSG_CastSpell_8F://??? |
1831 if ( pMessageQueue_50CBD0->uNumMessages ) | 1845 if ( pMessageQueue_50CBD0->uNumMessages ) |
1832 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1846 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1833 if ( unk_50C9A0 ) | 1847 if ( unk_50C9A0 ) |
1834 { | 1848 { |
1835 uActiveCharacter = uMessageParam; | 1849 uActiveCharacter = uMessageParam; |
1837 } | 1851 } |
1838 else | 1852 else |
1839 { | 1853 { |
1840 if ( pGUIWindow_Settings ) | 1854 if ( pGUIWindow_Settings ) |
1841 { | 1855 { |
1842 v52 = pGUIWindow_Settings->ptr_1C; | 1856 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1843 switch ( uMessage ) | 1857 switch ( uMessage ) |
1844 { | 1858 { |
1845 case 69: | 1859 case UIMSG_CastSpell_SPIRIT_Preservation: |
1846 *((char *)v52 + 8) &= 0xFDu; | 1860 LOBYTE(v51->field_8) &= 0xFDu; |
1847 break; | 1861 break; |
1848 case 141: | 1862 case UIMSG_CastSpell_SPIRIT_Fate: |
1849 *((char *)v52 + 9) &= 0xFEu; | 1863 HIBYTE(v51->field_8) &= 0xFEu; |
1850 break; | 1864 break; |
1851 case 143: | 1865 case UIMSG_CastSpell_8F: |
1852 *((char *)v52 + 9) &= 0xFDu; | 1866 HIBYTE(v51->field_8) &= 0xFDu; |
1853 break; | 1867 break; |
1854 } | 1868 } |
1855 *((short *)v52 + 2) = uMessageParam; | 1869 v51->uPlayerID_2 = uMessageParam; |
1856 pParty->pPlayers[*((short *)v52 + 1)].SetRecoveryTime(300); | 1870 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1857 pGUIWindow_Settings->Release(); | 1871 pGUIWindow_Settings->Release(); |
1858 pGUIWindow_Settings = 0; | 1872 pGUIWindow_Settings = 0; |
1859 pEventTimer->Resume(); | 1873 pEventTimer->Resume(); |
1860 pMouse->SetCursorBitmap("MICON1"); | 1874 pMouse->SetCursorBitmap("MICON1"); |
1861 GameUI_Footer_TimeLeft = 0; | 1875 GameUI_Footer_TimeLeft = 0; |
1862 unk_50C9A0 = 0; | 1876 unk_50C9A0 = 0; |
1863 } | 1877 } |
1864 } | 1878 } |
1865 continue; | 1879 continue; |
1866 case UIMSG_BF: | 1880 case UIMSG_BF: |
1881 __debugbreak(); | |
1867 dword_50CDC8 = 1; | 1882 dword_50CDC8 = 1; |
1868 sub_42FBDD(); | 1883 sub_42FBDD(); |
1869 SaveGame(1, 0); | 1884 SaveGame(1, 0); |
1870 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | 1885 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); |
1871 dword_6BE364_game_settings_1 |= 1; | 1886 dword_6BE364_game_settings_1 |= 1; |
1942 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" | 1957 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" |
1943 sub_41C0B8_set_status_string(pTmpBuf); | 1958 sub_41C0B8_set_status_string(pTmpBuf); |
1944 continue; | 1959 continue; |
1945 case UIMSG_CloseAfterInstallBeacon: | 1960 case UIMSG_CloseAfterInstallBeacon: |
1946 dword_50CDC8 = 1; | 1961 dword_50CDC8 = 1; |
1947 //goto LABEL_453; | |
1948 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 1962 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1949 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 1963 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
1950 continue; | 1964 continue; |
1951 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 1965 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
1952 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 1966 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2228 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | 2242 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." |
2229 ModalWindow(pFinalMessage, 196); | 2243 ModalWindow(pFinalMessage, 196); |
2230 uGameState = GAME_STATE_FINAL_WINDOW; | 2244 uGameState = GAME_STATE_FINAL_WINDOW; |
2231 continue; | 2245 continue; |
2232 case UIMSG_C4: | 2246 case UIMSG_C4: |
2233 __debugbreak; | 2247 __debugbreak(); |
2234 uGameState = GAME_STATE_PLAYING; | 2248 uGameState = GAME_STATE_PLAYING; |
2235 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | 2249 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); |
2236 goto LABEL_524; | 2250 goto LABEL_524; |
2237 case UIMSG_DD: | 2251 case UIMSG_DD: |
2238 LABEL_524: | 2252 LABEL_524: |
2356 continue; | 2370 continue; |
2357 } | 2371 } |
2358 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | 2372 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); |
2359 continue; | 2373 continue; |
2360 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, | 2374 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, |
2361 case UIMSG_CastSpell_GreatShot://Fireball, Spraying poison and other | 2375 case UIMSG_CastSpell_GreatShot://??? |
2362 if ( pRenderer->pRenderD3D ) | 2376 if ( pRenderer->pRenderD3D ) |
2363 { | 2377 { |
2364 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 2378 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2365 } | 2379 } |
2366 else | 2380 else |
2371 } | 2385 } |
2372 v83 = v81; | 2386 v83 = v81; |
2373 v44 = (unsigned __int16)v81; | 2387 v44 = (unsigned __int16)v81; |
2374 v84 = v83 >> 16; | 2388 v84 = v83 >> 16; |
2375 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | 2389 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
2376 //goto LABEL_90; | |
2377 { | 2390 { |
2378 v1 = ""; | 2391 v1 = ""; |
2379 //v0 = 1; | |
2380 continue; | 2392 continue; |
2381 } | 2393 } |
2382 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 2394 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
2383 if ( uMessage == 70 ) | 2395 if ( uMessage == UIMSG_CastSpell_SmallShot ) |
2384 { | 2396 { |
2385 *((char *)v51 + 8) &= 247; | 2397 LOBYTE(v51->field_8) &= 0xF7; |
2386 } | 2398 } |
2387 else | 2399 else |
2388 { | 2400 { |
2389 if ( uMessage == 140 ) | 2401 if ( uMessage == UIMSG_CastSpell_GreatShot ) |
2390 *((char *)v51 + 9) &= 0xFEu; | 2402 HIBYTE(v51->field_8) &= 0xFEu; |
2391 else | 2403 else |
2392 *((char *)v51 + 9) &= 0xFDu; | 2404 HIBYTE(v51->field_8) &= 0xFDu; |
2393 } | 2405 } |
2394 //goto LABEL_416; | 2406 //goto LABEL_416; |
2395 *((short *)v51 + 2) = uMessageParam; | 2407 v51->uPlayerID_2 = uMessageParam; |
2396 *((int *)v51 + 3) = v44; | 2408 v51->spell_target_pid = v44; |
2397 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 2409 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
2398 pWindow3 = pGUIWindow_Settings; | 2410 pWindow3 = pGUIWindow_Settings; |
2399 pWindow3->Release(); | 2411 pWindow3->Release(); |
2400 pGUIWindow_Settings = 0; | 2412 pGUIWindow_Settings = 0; |
2401 pMouse->SetCursorBitmap("MICON1"); | 2413 pMouse->SetCursorBitmap("MICON1"); |
2402 GameUI_Footer_TimeLeft = 0; | 2414 GameUI_Footer_TimeLeft = 0; |
2403 unk_50C9A0 = 0; | 2415 unk_50C9A0 = 0; |
2404 back_to_game(); | 2416 back_to_game(); |
2405 continue; | 2417 continue; |
2406 case UIMSG_1C: | 2418 case UIMSG_1C: |
2419 __debugbreak(); | |
2407 if ( !uActiveCharacter || pCurrentScreen ) | 2420 if ( !uActiveCharacter || pCurrentScreen ) |
2408 //goto LABEL_90; | |
2409 { | 2421 { |
2410 v1 = ""; | 2422 v1 = ""; |
2411 //v0 = 1; | |
2412 continue; | 2423 continue; |
2413 } | 2424 } |
2414 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); | 2425 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); |
2415 pCurrentScreen = SCREEN_19; | 2426 pCurrentScreen = SCREEN_19; |
2416 pEventTimer->Pause(); | 2427 pEventTimer->Pause(); |
2417 continue; | 2428 continue; |
2418 case UIMSG_1B: | 2429 case UIMSG_1B: |
2430 __debugbreak(); | |
2419 if ( !uActiveCharacter ) | 2431 if ( !uActiveCharacter ) |
2420 //goto LABEL_90; | 2432 //goto LABEL_90; |
2421 { | 2433 { |
2422 v1 = ""; | 2434 v1 = ""; |
2423 //v0 = 1; | 2435 //v0 = 1; |
2703 if ( uActiveCharacter ) | 2715 if ( uActiveCharacter ) |
2704 pPlayer10->PlaySound(SPEECH_12, 0); | 2716 pPlayer10->PlaySound(SPEECH_12, 0); |
2705 byte_506550 = 0; | 2717 byte_506550 = 0; |
2706 continue; | 2718 continue; |
2707 case UIMSG_33: | 2719 case UIMSG_33: |
2720 __debugbreak(); | |
2708 if ( !uActiveCharacter ) | 2721 if ( !uActiveCharacter ) |
2709 continue; | 2722 continue; |
2710 pPlayer3 = pPlayers[uActiveCharacter]; | 2723 pPlayer3 = pPlayers[uActiveCharacter]; |
2711 pNPCData4 = 0; | 2724 pNPCData4 = 0; |
2712 uAction = 0; | 2725 uAction = 0; |
2800 if ( pTurnEngine->field_4 != 3 ) | 2813 if ( pTurnEngine->field_4 != 3 ) |
2801 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | 2814 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); |
2802 continue; | 2815 continue; |
2803 | 2816 |
2804 case UIMSG_92: | 2817 case UIMSG_92: |
2818 __debugbreak(); | |
2805 if ( pTurnEngine->field_4 != 3 ) | 2819 if ( pTurnEngine->field_4 != 3 ) |
2806 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); | 2820 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); |
2807 continue; | 2821 continue; |
2808 case UIMSG_SpellBookWindow: | 2822 case UIMSG_SpellBookWindow: |
2809 if ( pTurnEngine->field_4 == 3 ) | 2823 if ( pTurnEngine->field_4 == 3 ) |
2889 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2903 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
2890 ++pMessageQueue_50CBD0->uNumMessages;*/ | 2904 ++pMessageQueue_50CBD0->uNumMessages;*/ |
2891 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2905 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
2892 continue; | 2906 continue; |
2893 case UIMSG_C0: | 2907 case UIMSG_C0: |
2908 __debugbreak(); | |
2894 dword_50651C = 1; | 2909 dword_50651C = 1; |
2895 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | 2910 if ( pMouse->GetCursorPos(&v211)->y > 178 ) |
2896 dword_50651C = -1; | 2911 dword_50651C = -1; |
2897 continue; | 2912 continue; |
2898 case UIMSG_ClickAwardsUpBtn: | 2913 case UIMSG_ClickAwardsUpBtn: |
3088 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" | 3103 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" |
3089 v114 = v110->GetMaxHealth(); | 3104 v114 = v110->GetMaxHealth(); |
3090 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); | 3105 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); |
3091 sub_41C0B8_set_status_string(pTmpBuf); | 3106 sub_41C0B8_set_status_string(pTmpBuf); |
3092 continue; | 3107 continue; |
3093 case UIMSG_C: | 3108 case UIMSG_CHEST_ClickItem: |
3094 if ( pCurrentScreen == SCREEN_F ) | 3109 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) |
3095 { | 3110 { |
3096 sub_421EA6_OnInventoryLeftClick(); | 3111 OnInventoryLeftClick(); |
3097 continue; | 3112 continue; |
3098 } | 3113 } |
3099 sub_420E01(); | 3114 OnChestLeftClick(); |
3100 continue; | 3115 continue; |
3101 case UIMSG_InventoryLeftClick: | 3116 case UIMSG_InventoryLeftClick: |
3102 sub_421EA6_OnInventoryLeftClick(); | 3117 OnInventoryLeftClick(); |
3103 continue; | 3118 continue; |
3104 case UIMSG_MouseLeftClickInGame: | 3119 case UIMSG_MouseLeftClickInGame: |
3105 if ( !pRenderer->pRenderD3D ) | 3120 if ( !pRenderer->pRenderD3D ) |
3106 { | 3121 { |
3107 if ( pMessageQueue_50CBD0->uNumMessages ) | 3122 if ( pMessageQueue_50CBD0->uNumMessages ) |
3149 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3164 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3150 ++pMessageQueue_50CBD0->uNumMessages; | 3165 ++pMessageQueue_50CBD0->uNumMessages; |
3151 continue; | 3166 continue; |
3152 }*/ | 3167 }*/ |
3153 continue; | 3168 continue; |
3154 case UIMSG_E://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame | 3169 case UIMSG_E: |
3170 __debugbreak();//срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame | |
3155 if ( pMessageQueue_50CBD0->uNumMessages ) | 3171 if ( pMessageQueue_50CBD0->uNumMessages ) |
3156 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3172 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3157 OnGameViewportClick(); | 3173 OnGameViewportClick(); |
3158 continue; | 3174 continue; |
3159 case UIMSG_F: | 3175 case UIMSG_F: |
3176 __debugbreak(); | |
3160 if ( pRenderer->pRenderD3D ) | 3177 if ( pRenderer->pRenderD3D ) |
3161 { | 3178 { |
3162 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | 3179 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
3163 } | 3180 } |
3164 else | 3181 else |
3169 } | 3186 } |
3170 pButton2 = (GUIButton *)(unsigned __int16)v116; | 3187 pButton2 = (GUIButton *)(unsigned __int16)v116; |
3171 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); | 3188 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); |
3172 continue; | 3189 continue; |
3173 case UIMSG_54: | 3190 case UIMSG_54: |
3191 __debugbreak(); | |
3174 pButton2 = (GUIButton *)uMessageParam; | 3192 pButton2 = (GUIButton *)uMessageParam; |
3175 GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); | 3193 GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); |
3176 continue; | 3194 continue; |
3177 case UIMSG_Game_Action: | 3195 case UIMSG_Game_Action: |
3178 if ( pMessageQueue_50CBD0->uNumMessages ) | 3196 if ( pMessageQueue_50CBD0->uNumMessages ) |
10276 { | 10294 { |
10277 if ( pCurrentScreen == SCREEN_CHEST ) | 10295 if ( pCurrentScreen == SCREEN_CHEST ) |
10278 { | 10296 { |
10279 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); | 10297 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); |
10280 } | 10298 } |
10281 else if ( pCurrentScreen == SCREEN_F ) | 10299 else if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) |
10282 { | 10300 { |
10283 pRenderer->ClearZBuffer(0, 479); | 10301 pRenderer->ClearZBuffer(0, 479); |
10284 draw_leather(); | 10302 draw_leather(); |
10285 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 10303 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
10286 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | 10304 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); |