Mercurial > mm7
comparison mm7_5.cpp @ 992:3a3ab572eff5
Merge
author | Nomad |
---|---|
date | Mon, 13 May 2013 17:07:52 +0200 |
parents | c5d8ea1e6ccb 087a9af8e0ec |
children | 3431f6abc786 1c13fbaad0c5 |
comparison
equal
deleted
inserted
replaced
991:c5d8ea1e6ccb | 992:3a3ab572eff5 |
---|---|
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 switch ( pCurrentScreen ) |
977 { | 979 { |
978 if ( pCurrentScreen >= SCREEN_CHANGE_LOCATION && (pCurrentScreen <= SCREEN_INPUT_BLV || pCurrentScreen == SCREEN_QUICK_REFERENCE) ) | 980 case SCREEN_E: |
979 { | 981 __debugbreak(); |
982 case SCREEN_NPC_DIALOGUE: | |
983 case SCREEN_CHEST: | |
984 case SCREEN_CHEST_INVENTORY: | |
985 case SCREEN_CHANGE_LOCATION: | |
986 case SCREEN_INPUT_BLV: | |
987 case SCREEN_QUICK_REFERENCE: | |
980 if ( dword_50CDC8 ) | 988 if ( dword_50CDC8 ) |
981 goto LABEL_232; | 989 break; |
982 CloseWindowBackground(); | 990 CloseWindowBackground(); |
983 uMessageParam = 1; | 991 uMessageParam = 1; |
984 goto LABEL_232; | 992 break; |
985 } | 993 case SCREEN_HOUSE: |
986 } | 994 if ( !dword_50CDC8 && !dword_5C35C8 ) |
987 else | 995 { |
988 { | 996 CloseWindowBackground(); |
989 if ( pCurrentScreen >= SCREEN_E || pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHEST ) | 997 dword_5C35C8 = 0; |
990 { | 998 uMessageParam = 1; |
991 if ( dword_50CDC8 ) | 999 break; |
992 goto LABEL_232; | 1000 } |
993 CloseWindowBackground(); | 1001 break; |
994 uMessageParam = 1; | 1002 } |
995 goto LABEL_232; | |
996 } | |
997 if ( pCurrentScreen == SCREEN_HOUSE && !dword_50CDC8 && !dword_5C35C8 ) | |
998 { | |
999 CloseWindowBackground(); | |
1000 dword_5C35C8 = 0; | |
1001 uMessageParam = 1; | |
1002 } | |
1003 } | |
1004 LABEL_232: | |
1005 if ( !ptr_507BDC ) | 1003 if ( !ptr_507BDC ) |
1006 { | 1004 { |
1007 pRenderer->ClearZBuffer(0, 479); | 1005 pRenderer->ClearZBuffer(0, 479); |
1008 viewparams->bRedrawGameUI = 1; | 1006 viewparams->bRedrawGameUI = 1; |
1009 viewparams->field_48 = 1; | 1007 viewparams->field_48 = 1; |
1010 if ( pCurrentScreen ) | 1008 if ( pCurrentScreen ) |
1011 { | 1009 { |
1012 if ( pCurrentScreen > SCREEN_67 ) | 1010 if ( pCurrentScreen > SCREEN_67 ) |
1013 { | 1011 { |
1014 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE ) | 1012 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE ) |
1015 goto LABEL_321; | 1013 { |
1014 pIcons_LOD->_4114F2(); | |
1015 if ( pGUIWindow_Settings ) | |
1016 { | |
1017 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
1018 { | |
1019 pMouse->SetCursorBitmap("MICON2"); | |
1020 } | |
1021 else | |
1022 { | |
1023 pGUIWindow_Settings->Release(); | |
1024 pGUIWindow_Settings = 0; | |
1025 pMouse->SetCursorBitmap("MICON1"); | |
1026 GameUI_Footer_TimeLeft = 0; | |
1027 unk_50C9A0 = 0; | |
1028 back_to_game(); | |
1029 } | |
1030 } | |
1031 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
1032 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1033 pGUIWindow_CurrentMenu->Release(); | |
1034 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1035 window_SpeakInHouse = 0; | |
1036 pGUIWindow_CurrentMenu = 0; | |
1037 pEventTimer->Resume(); | |
1038 pCurrentScreen = SCREEN_GAME; | |
1039 viewparams->bRedrawGameUI = 1; | |
1040 pIcons_LOD->_4355F7(); | |
1041 continue; | |
1042 } | |
1016 } | 1043 } |
1017 else | 1044 else |
1018 { | 1045 { |
1019 if ( pCurrentScreen < SCREEN_64 ) | 1046 if ( pCurrentScreen < SCREEN_64 ) |
1020 { | 1047 { |
1102 case SCREEN_LOADGAME: | 1129 case SCREEN_LOADGAME: |
1103 pIcons_LOD->_4114F2(); | 1130 pIcons_LOD->_4114F2(); |
1104 //crt_deconstruct_ptr_6A0118(); | 1131 //crt_deconstruct_ptr_6A0118(); |
1105 stru_506E40.Release(); | 1132 stru_506E40.Release(); |
1106 break; | 1133 break; |
1107 case SCREEN_F: | 1134 case SCREEN_CHEST_INVENTORY: |
1108 pCurrentScreen = SCREEN_CHEST; | 1135 pCurrentScreen = SCREEN_CHEST; |
1109 continue; | 1136 continue; |
1110 case SCREEN_CHEST: | 1137 case SCREEN_CHEST: |
1111 pWindow2 = pChestWindow; | 1138 pWindow2 = pChestWindow; |
1112 pWindow2->Release(); | 1139 pWindow2->Release(); |
1114 pCurrentScreen = SCREEN_GAME; | 1141 pCurrentScreen = SCREEN_GAME; |
1115 viewparams->bRedrawGameUI = 1; | 1142 viewparams->bRedrawGameUI = 1; |
1116 pEventTimer->Resume(); | 1143 pEventTimer->Resume(); |
1117 continue; | 1144 continue; |
1118 case SCREEN_19: | 1145 case SCREEN_19: |
1146 __debugbreak(); | |
1119 pWindow2 = ptr_507BC8; | 1147 pWindow2 = ptr_507BC8; |
1120 pWindow2->Release(); | 1148 pWindow2->Release(); |
1121 pIcons_LOD->_4114F2(); | 1149 pIcons_LOD->_4114F2(); |
1122 pCurrentScreen = SCREEN_GAME; | 1150 pCurrentScreen = SCREEN_GAME; |
1123 viewparams->bRedrawGameUI = 1; | 1151 viewparams->bRedrawGameUI = 1; |
1124 pEventTimer->Resume(); | 1152 pEventTimer->Resume(); |
1125 continue; | 1153 continue; |
1126 case SCREEN_OPTIONS://Close | 1154 case SCREEN_OPTIONS://Close |
1127 options_menu_skin.Relaease(); | 1155 options_menu_skin.Relaease(); |
1128 | |
1129 pIcons_LOD->_40F9C5(); | 1156 pIcons_LOD->_40F9C5(); |
1130 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); | 1157 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); |
1131 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | 1158 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); |
1132 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | 1159 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); |
1133 WriteWindowsRegistryInt("WalkSound", bWalkSound); | 1160 WriteWindowsRegistryInt("WalkSound", bWalkSound); |
1135 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); | 1162 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); |
1136 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); | 1163 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
1137 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); | 1164 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); |
1138 if ( !uTurnSpeed ) | 1165 if ( !uTurnSpeed ) |
1139 { | 1166 { |
1140 //v171 = 3; | |
1141 //v30 = v171; | |
1142 //v31 = "TurnDelta"; | |
1143 WriteWindowsRegistryInt("TurnDelta", 3); | 1167 WriteWindowsRegistryInt("TurnDelta", 3); |
1144 stru_506E40.Release(); | 1168 stru_506E40.Release(); |
1145 break; | 1169 break; |
1146 } | 1170 } |
1147 if ( uTurnSpeed == 64 ) | 1171 if ( uTurnSpeed == 64 ) |
1148 { | 1172 { |
1149 //v171 = 2; | |
1150 //v30 = v171; | |
1151 //v31 = "TurnDelta"; | |
1152 WriteWindowsRegistryInt("TurnDelta", 2); | 1173 WriteWindowsRegistryInt("TurnDelta", 2); |
1153 stru_506E40.Release(); | 1174 stru_506E40.Release(); |
1154 break; | 1175 break; |
1155 } | 1176 } |
1156 if ( uTurnSpeed != 128 ) | 1177 if ( uTurnSpeed != 128 ) |
1157 { | 1178 { |
1158 stru_506E40.Release(); | 1179 stru_506E40.Release(); |
1159 break; | 1180 break; |
1160 } | 1181 } |
1161 //v30 = v0; | |
1162 //v31 = "TurnDelta"; | |
1163 WriteWindowsRegistryInt("TurnDelta", 1); | 1182 WriteWindowsRegistryInt("TurnDelta", 1); |
1164 stru_506E40.Release(); | 1183 stru_506E40.Release(); |
1165 break; | 1184 break; |
1166 case SCREEN_MENU: | 1185 case SCREEN_MENU: |
1167 pIcons_LOD->_40F9C5(); | 1186 pIcons_LOD->_40F9C5(); |
1281 pCurrentScreen = SCREEN_GAME; | 1300 pCurrentScreen = SCREEN_GAME; |
1282 viewparams->bRedrawGameUI = 1; | 1301 viewparams->bRedrawGameUI = 1; |
1283 pIcons_LOD->_4355F7(); | 1302 pIcons_LOD->_4355F7(); |
1284 continue; | 1303 continue; |
1285 case SCREEN_E: | 1304 case SCREEN_E: |
1305 __debugbreak(); | |
1286 pGUIWindow_CurrentMenu->Release(); | 1306 pGUIWindow_CurrentMenu->Release(); |
1287 pCurrentScreen = SCREEN_HOUSE; | 1307 pCurrentScreen = SCREEN_HOUSE; |
1288 pIcons_LOD->_4114F2(); | 1308 pIcons_LOD->_4114F2(); |
1289 continue; | 1309 continue; |
1290 case SCREEN_HOUSE: | 1310 case SCREEN_HOUSE: |
1329 pEventTimer->Resume(); | 1349 pEventTimer->Resume(); |
1330 pCurrentScreen = SCREEN_GAME; | 1350 pCurrentScreen = SCREEN_GAME; |
1331 viewparams->bRedrawGameUI = 1; | 1351 viewparams->bRedrawGameUI = 1; |
1332 pIcons_LOD->_4355F7(); | 1352 pIcons_LOD->_4355F7(); |
1333 continue; | 1353 continue; |
1334 case SCREEN_INPUT_BLV: | 1354 case SCREEN_INPUT_BLV://click escape |
1335 if ( uCurrentHouse_Animation == 153 ) | 1355 if ( uCurrentHouse_Animation == 153 ) |
1336 PlayHouseSound(0x99u, HouseSound_Greeting_2); | 1356 PlayHouseSound(0x99u, HouseSound_Greeting_2); |
1337 pVideoPlayer->Unload(); | 1357 pVideoPlayer->Unload(); |
1338 if ( dword_5B65CC ) | 1358 if ( dword_5B65CC ) |
1339 { | 1359 { |
1341 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | 1361 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; |
1342 Party__CountHirelings(); | 1362 Party__CountHirelings(); |
1343 viewparams->bRedrawGameUI = 1; | 1363 viewparams->bRedrawGameUI = 1; |
1344 dword_5B65CC = 0; | 1364 dword_5B65CC = 0; |
1345 } | 1365 } |
1346 goto LABEL_317; | 1366 DialogueEnding(); |
1347 case SCREEN_NPC_DIALOGUE: | 1367 pCurrentScreen = SCREEN_GAME; |
1368 viewparams->bRedrawGameUI = 1; | |
1369 continue; | |
1370 case SCREEN_NPC_DIALOGUE://click escape | |
1348 if ( dword_5B65CC ) | 1371 if ( dword_5B65CC ) |
1349 { | 1372 { |
1350 pParty->field_709 = 0; | 1373 pParty->field_709 = 0; |
1351 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | 1374 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; |
1352 Party__CountHirelings(); | 1375 Party__CountHirelings(); |
1353 viewparams->bRedrawGameUI = 1; | 1376 viewparams->bRedrawGameUI = 1; |
1354 dword_5B65CC = 0; | 1377 dword_5B65CC = 0; |
1355 } | 1378 } |
1356 goto LABEL_317; | 1379 //goto LABEL_317; |
1357 case SCREEN_BRANCHLESS_NPC_DIALOG: | 1380 DialogueEnding(); |
1381 pCurrentScreen = SCREEN_GAME; | |
1382 viewparams->bRedrawGameUI = 1; | |
1383 continue; | |
1384 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
1358 memset(GameUI_Footer_TimedString, 0, 0xC8u); | 1385 memset(GameUI_Footer_TimedString, 0, 0xC8u); |
1359 sub_4452BB(); | 1386 sub_4452BB(); |
1360 goto LABEL_317; | 1387 DialogueEnding(); |
1361 case SCREEN_CHANGE_LOCATION: | 1388 pCurrentScreen = SCREEN_GAME; |
1389 viewparams->bRedrawGameUI = 1; | |
1390 continue; | |
1391 case SCREEN_CHANGE_LOCATION://click escape | |
1362 if ( pParty->vPosition.x < -22528 ) | 1392 if ( pParty->vPosition.x < -22528 ) |
1363 pParty->vPosition.x = -22528; | 1393 pParty->vPosition.x = -22528; |
1364 if ( pParty->vPosition.x > 22528 ) | 1394 if ( pParty->vPosition.x > 22528 ) |
1365 pParty->vPosition.x = 22528; | 1395 pParty->vPosition.x = 22528; |
1366 if ( pParty->vPosition.y < -22528 ) | 1396 if ( pParty->vPosition.y < -22528 ) |
1367 pParty->vPosition.y = -22528; | 1397 pParty->vPosition.y = -22528; |
1368 if ( pParty->vPosition.y > 22528 ) | 1398 if ( pParty->vPosition.y > 22528 ) |
1369 pParty->vPosition.y = 22528; | 1399 pParty->vPosition.y = 22528; |
1370 goto LABEL_317; | 1400 DialogueEnding(); |
1401 pCurrentScreen = SCREEN_GAME; | |
1402 viewparams->bRedrawGameUI = 1; | |
1403 continue; | |
1371 case SCREEN_VIDEO: | 1404 case SCREEN_VIDEO: |
1372 pVideoPlayer->Unload(); | 1405 pVideoPlayer->Unload(); |
1373 continue; | 1406 continue; |
1374 case SCREEN_CHARACTERS: | 1407 case SCREEN_CHARACTERS: |
1375 goto LABEL_319; | 1408 CharacterUI_ReleaseButtons(); |
1409 sub_419379(); | |
1410 pIcons_LOD->_4114F2(); | |
1411 if ( pGUIWindow_Settings ) | |
1412 { | |
1413 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
1414 { | |
1415 pMouse->SetCursorBitmap("MICON2"); | |
1416 } | |
1417 else | |
1418 { | |
1419 pGUIWindow_Settings->Release(); | |
1420 pGUIWindow_Settings = 0; | |
1421 pMouse->SetCursorBitmap("MICON1"); | |
1422 GameUI_Footer_TimeLeft = 0; | |
1423 unk_50C9A0 = 0; | |
1424 back_to_game(); | |
1425 } | |
1426 } | |
1427 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
1428 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1429 pGUIWindow_CurrentMenu->Release(); | |
1430 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1431 window_SpeakInHouse = 0; | |
1432 pGUIWindow_CurrentMenu = 0; | |
1433 pEventTimer->Resume(); | |
1434 pCurrentScreen = SCREEN_GAME; | |
1435 viewparams->bRedrawGameUI = 1; | |
1436 pIcons_LOD->_4355F7(); | |
1437 continue; | |
1376 default: | 1438 default: |
1377 if ( pGUIWindow_Settings ) | 1439 if ( pGUIWindow_Settings ) |
1378 { | 1440 { |
1379 if ( pCurrentScreen == SCREEN_CHARACTERS ) | 1441 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
1380 { | 1442 { |
1431 continue; | 1493 continue; |
1432 } | 1494 } |
1433 LABEL_319: | 1495 LABEL_319: |
1434 CharacterUI_ReleaseButtons(); | 1496 CharacterUI_ReleaseButtons(); |
1435 sub_419379(); | 1497 sub_419379(); |
1436 LABEL_321: | |
1437 pIcons_LOD->_4114F2(); | 1498 pIcons_LOD->_4114F2(); |
1438 } | 1499 } |
1439 if ( pGUIWindow_Settings ) | 1500 if ( pGUIWindow_Settings ) |
1440 { | 1501 { |
1441 if ( pCurrentScreen == SCREEN_CHARACTERS ) | 1502 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
1626 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | 1687 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); |
1627 if ( bUnderwater != 1 && pParty->bFlying | 1688 if ( bUnderwater != 1 && pParty->bFlying |
1628 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | 1689 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) |
1629 { | 1690 { |
1630 viewparams->bRedrawGameUI = 1; | 1691 viewparams->bRedrawGameUI = 1; |
1631 LABEL_387: | |
1632 CloseWindowBackground(); | 1692 CloseWindowBackground(); |
1633 if ( pParty->vPosition.x < -22528 ) | 1693 if ( pParty->vPosition.x < -22528 ) |
1634 pParty->vPosition.x = -22528; | 1694 pParty->vPosition.x = -22528; |
1635 if ( pParty->vPosition.x > 22528 ) | 1695 if ( pParty->vPosition.x > 22528 ) |
1636 pParty->vPosition.x = 22528; | 1696 pParty->vPosition.x = 22528; |
1637 if ( pParty->vPosition.y < -22528 ) | 1697 if ( pParty->vPosition.y < -22528 ) |
1638 pParty->vPosition.y = -22528; | 1698 pParty->vPosition.y = -22528; |
1639 if ( pParty->vPosition.y > 22528 ) | 1699 if ( pParty->vPosition.y > 22528 ) |
1640 pParty->vPosition.y = 22528; | 1700 pParty->vPosition.y = 22528; |
1641 LABEL_317: | |
1642 DialogueEnding(); | 1701 DialogueEnding(); |
1643 pCurrentScreen = SCREEN_GAME; | 1702 pCurrentScreen = SCREEN_GAME; |
1644 } | 1703 } |
1645 else | 1704 else |
1646 { | 1705 { |
1699 bUnderwater = 1; | 1758 bUnderwater = 1; |
1700 pGame->uFlags2 |= 8u; | 1759 pGame->uFlags2 |= 8u; |
1701 } | 1760 } |
1702 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d47.blv") ) | 1761 if ( !_strcmpi(pCurrentMapName, "out15.odm") || !_strcmpi(pCurrentMapName, "d47.blv") ) |
1703 bNoNPCHiring = 1; | 1762 bNoNPCHiring = 1; |
1704 //v0 = 1; | |
1705 PrepareToLoadODM(1u, (OutdoorCamera *)1); | 1763 PrepareToLoadODM(1u, (OutdoorCamera *)1); |
1706 pAudioPlayer->SetMapEAX(); | 1764 pAudioPlayer->SetMapEAX(); |
1707 bDialogueUI_InitializeActor_NPC_ID = 0; | 1765 bDialogueUI_InitializeActor_NPC_ID = 0; |
1708 OnMapLoad(); | 1766 OnMapLoad(); |
1709 pOutdoor->SetFog(); | 1767 pOutdoor->SetFog(); |
1716 pCurrentScreen = SCREEN_GAME; | 1774 pCurrentScreen = SCREEN_GAME; |
1717 pGameLoadingUI_ProgressBar->Release(); | 1775 pGameLoadingUI_ProgressBar->Release(); |
1718 } | 1776 } |
1719 viewparams->bRedrawGameUI = 1; | 1777 viewparams->bRedrawGameUI = 1; |
1720 continue; | 1778 continue; |
1721 case UIMSG_5B: | 1779 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: |
1722 goto LABEL_387; | 1780 CloseWindowBackground(); |
1723 case UIMSG_CastSpell_BE: | 1781 if ( pParty->vPosition.x < -22528 ) |
1782 pParty->vPosition.x = -22528; | |
1783 if ( pParty->vPosition.x > 22528 ) | |
1784 pParty->vPosition.x = 22528; | |
1785 if ( pParty->vPosition.y < -22528 ) | |
1786 pParty->vPosition.y = -22528; | |
1787 if ( pParty->vPosition.y > 22528 ) | |
1788 pParty->vPosition.y = 22528; | |
1789 DialogueEnding(); | |
1790 pCurrentScreen = SCREEN_GAME; | |
1791 viewparams->bRedrawGameUI = 1; | |
1792 continue; | |
1793 case UIMSG_CastSpell_BE://??? | |
1794 __debugbreak(); | |
1724 if ( pRenderer->pRenderD3D ) | 1795 if ( pRenderer->pRenderD3D ) |
1725 { | 1796 { |
1726 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); | 1797 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1727 } | 1798 } |
1728 else | 1799 else |
1739 { | 1810 { |
1740 v47 = pActors[v46].uAIState == Dead; | 1811 v47 = pActors[v46].uAIState == Dead; |
1741 if ( !v47 ) | 1812 if ( !v47 ) |
1742 continue; | 1813 continue; |
1743 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1814 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1744 *((char *)v51 + 8) &= 0xBFu; | 1815 LOBYTE(v51->field_8) &= 0xBFu; |
1745 *((short *)v51 + 2) = uMessageParam; | 1816 v51->uPlayerID_2 = uMessageParam; |
1746 *((int *)v51 + 3) = v44; | 1817 v51->spell_target_pid = v44; |
1747 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1818 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1748 pWindow3 = pGUIWindow_Settings; | 1819 pWindow3 = pGUIWindow_Settings; |
1749 pWindow3->Release(); | 1820 pWindow3->Release(); |
1750 pGUIWindow_Settings = 0; | 1821 pGUIWindow_Settings = 0; |
1751 pMouse->SetCursorBitmap("MICON1"); | 1822 pMouse->SetCursorBitmap("MICON1"); |
1752 GameUI_Footer_TimeLeft = 0; | 1823 GameUI_Footer_TimeLeft = 0; |
1758 { | 1829 { |
1759 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | 1830 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; |
1760 if ( !v47 ) | 1831 if ( !v47 ) |
1761 continue; | 1832 continue; |
1762 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1833 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1763 *((char *)v51 + 8) &= 0xBFu; | 1834 LOBYTE(v51->field_8) &= 0xBFu; |
1764 *((short *)v51 + 2) = uMessageParam; | 1835 v51->uPlayerID_2 = uMessageParam; |
1765 *((int *)v51 + 3) = v44; | 1836 v51->spell_target_pid = v44; |
1766 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1837 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1767 pWindow3 = pGUIWindow_Settings; | 1838 pWindow3 = pGUIWindow_Settings; |
1768 pWindow3->Release(); | 1839 pWindow3->Release(); |
1769 pGUIWindow_Settings = 0; | 1840 pGUIWindow_Settings = 0; |
1770 pMouse->SetCursorBitmap("MICON1"); | 1841 pMouse->SetCursorBitmap("MICON1"); |
1771 GameUI_Footer_TimeLeft = 0; | 1842 GameUI_Footer_TimeLeft = 0; |
1785 { | 1856 { |
1786 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | 1857 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; |
1787 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) | 1858 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) |
1788 continue; | 1859 continue; |
1789 v44 = uNumSeconds; | 1860 v44 = uNumSeconds; |
1790 //goto LABEL_415; | |
1791 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1861 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1792 *((char *)v51 + 8) &= 0xBFu; | 1862 *((char *)v51 + 8) &= 0xBFu; |
1793 *((short *)v51 + 2) = uMessageParam; | 1863 v51->uPlayerID_2 = uMessageParam; |
1794 *((int *)v51 + 3) = v44; | 1864 v51->spell_target_pid = v44; |
1795 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | 1865 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1796 pWindow3 = pGUIWindow_Settings; | 1866 pWindow3 = pGUIWindow_Settings; |
1797 pWindow3->Release(); | 1867 pWindow3->Release(); |
1798 pGUIWindow_Settings = 0; | 1868 pGUIWindow_Settings = 0; |
1799 pMouse->SetCursorBitmap("MICON1"); | 1869 pMouse->SetCursorBitmap("MICON1"); |
1800 GameUI_Footer_TimeLeft = 0; | 1870 GameUI_Footer_TimeLeft = 0; |
1807 continue; | 1877 continue; |
1808 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | 1878 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; |
1809 } | 1879 } |
1810 if ( v48 ) | 1880 if ( v48 ) |
1811 continue; | 1881 continue; |
1812 //LABEL_415: | |
1813 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1882 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1814 *((char *)v51 + 8) &= 0xBFu; | 1883 LOBYTE(v51->field_8) &= 0xBFu; |
1815 //LABEL_416: | 1884 v51->uPlayerID_2 = uMessageParam; |
1816 *((short *)v51 + 2) = uMessageParam; | 1885 v51->spell_target_pid = v44; |
1817 *((int *)v51 + 3) = v44; | 1886 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1818 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); | |
1819 pWindow3 = pGUIWindow_Settings; | 1887 pWindow3 = pGUIWindow_Settings; |
1820 //LABEL_333: | |
1821 pWindow3->Release(); | 1888 pWindow3->Release(); |
1822 pGUIWindow_Settings = 0; | 1889 pGUIWindow_Settings = 0; |
1823 pMouse->SetCursorBitmap("MICON1"); | 1890 pMouse->SetCursorBitmap("MICON1"); |
1824 GameUI_Footer_TimeLeft = 0; | 1891 GameUI_Footer_TimeLeft = 0; |
1825 unk_50C9A0 = 0; | 1892 unk_50C9A0 = 0; |
1826 back_to_game(); | 1893 back_to_game(); |
1827 continue; | 1894 continue; |
1828 case UIMSG_CastSpell_SPIRIT_Preservation: | 1895 case UIMSG_CastSpell_8F: |
1829 case UIMSG_CastSpell_8D: | 1896 __debugbreak(); |
1830 case UIMSG_8F: | 1897 case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade) |
1898 case UIMSG_CastSpell_SPIRIT_Fate: | |
1831 if ( pMessageQueue_50CBD0->uNumMessages ) | 1899 if ( pMessageQueue_50CBD0->uNumMessages ) |
1832 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1900 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1833 if ( unk_50C9A0 ) | 1901 if ( unk_50C9A0 ) |
1834 { | 1902 { |
1835 uActiveCharacter = uMessageParam; | 1903 uActiveCharacter = uMessageParam; |
1837 } | 1905 } |
1838 else | 1906 else |
1839 { | 1907 { |
1840 if ( pGUIWindow_Settings ) | 1908 if ( pGUIWindow_Settings ) |
1841 { | 1909 { |
1842 v52 = pGUIWindow_Settings->ptr_1C; | 1910 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1843 switch ( uMessage ) | 1911 switch ( uMessage ) |
1844 { | 1912 { |
1845 case 69: | 1913 case UIMSG_CastSpell_SPIRIT_Preservation: |
1846 *((char *)v52 + 8) &= 0xFDu; | 1914 LOBYTE(v51->field_8) &= 0xFDu; |
1847 break; | 1915 break; |
1848 case 141: | 1916 case UIMSG_CastSpell_SPIRIT_Fate: |
1849 *((char *)v52 + 9) &= 0xFEu; | 1917 HIBYTE(v51->field_8) &= 0xFEu; |
1850 break; | 1918 break; |
1851 case 143: | 1919 case UIMSG_CastSpell_8F: |
1852 *((char *)v52 + 9) &= 0xFDu; | 1920 HIBYTE(v51->field_8) &= 0xFDu; |
1853 break; | 1921 break; |
1854 } | 1922 } |
1855 *((short *)v52 + 2) = uMessageParam; | 1923 v51->uPlayerID_2 = uMessageParam; |
1856 pParty->pPlayers[*((short *)v52 + 1)].SetRecoveryTime(300); | 1924 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
1857 pGUIWindow_Settings->Release(); | 1925 pGUIWindow_Settings->Release(); |
1858 pGUIWindow_Settings = 0; | 1926 pGUIWindow_Settings = 0; |
1859 pEventTimer->Resume(); | 1927 pEventTimer->Resume(); |
1860 pMouse->SetCursorBitmap("MICON1"); | 1928 pMouse->SetCursorBitmap("MICON1"); |
1861 GameUI_Footer_TimeLeft = 0; | 1929 GameUI_Footer_TimeLeft = 0; |
1862 unk_50C9A0 = 0; | 1930 unk_50C9A0 = 0; |
1863 } | 1931 } |
1864 } | 1932 } |
1865 continue; | 1933 continue; |
1866 case UIMSG_BF: | 1934 case UIMSG_BF: |
1935 __debugbreak(); | |
1867 dword_50CDC8 = 1; | 1936 dword_50CDC8 = 1; |
1868 sub_42FBDD(); | 1937 sub_42FBDD(); |
1869 SaveGame(1, 0); | 1938 SaveGame(1, 0); |
1870 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | 1939 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); |
1871 dword_6BE364_game_settings_1 |= 1; | 1940 dword_6BE364_game_settings_1 |= 1; |
1888 } | 1957 } |
1889 sub_4BD8B5(); | 1958 sub_4BD8B5(); |
1890 //goto LABEL_434; | 1959 //goto LABEL_434; |
1891 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 1960 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
1892 { | 1961 { |
1893 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 1962 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
1894 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | 1963 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
1895 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 1964 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
1896 ++pMessageQueue_50CBD0->uNumMessages; | 1965 ++pMessageQueue_50CBD0->uNumMessages; |
1897 }*/ | 1966 }*/ |
1898 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 1967 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
1942 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" | 2011 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" |
1943 sub_41C0B8_set_status_string(pTmpBuf); | 2012 sub_41C0B8_set_status_string(pTmpBuf); |
1944 continue; | 2013 continue; |
1945 case UIMSG_CloseAfterInstallBeacon: | 2014 case UIMSG_CloseAfterInstallBeacon: |
1946 dword_50CDC8 = 1; | 2015 dword_50CDC8 = 1; |
1947 //goto LABEL_453; | |
1948 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2016 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1949 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 2017 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
1950 continue; | 2018 continue; |
1951 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 2019 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
1952 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 2020 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
1953 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2021 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
1954 ++pMessageQueue_50CBD0->uNumMessages;*/ | 2022 ++pMessageQueue_50CBD0->uNumMessages;*/ |
1955 continue; | 2023 continue; |
1956 case UIMSG_InstallBeacon: | 2024 case UIMSG_InstallBeacon: |
2092 v67 = pGUIWindow_CurrentMenu->Hint; | 2160 v67 = pGUIWindow_CurrentMenu->Hint; |
2093 if ( v67 ) | 2161 if ( v67 ) |
2094 *((int *)v67 + 17) = 1; | 2162 *((int *)v67 + 17) = 1; |
2095 else | 2163 else |
2096 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); | 2164 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); |
2097 //LABEL_434: | |
2098 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 2165 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
2099 { | 2166 { |
2100 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 2167 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
2101 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | 2168 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
2102 //LABEL_771: | |
2103 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2169 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
2104 ++pMessageQueue_50CBD0->uNumMessages; | 2170 ++pMessageQueue_50CBD0->uNumMessages; |
2105 }*/ | 2171 }*/ |
2106 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 2172 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
2107 continue; | 2173 continue; |
2228 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | 2294 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." |
2229 ModalWindow(pFinalMessage, 196); | 2295 ModalWindow(pFinalMessage, 196); |
2230 uGameState = GAME_STATE_FINAL_WINDOW; | 2296 uGameState = GAME_STATE_FINAL_WINDOW; |
2231 continue; | 2297 continue; |
2232 case UIMSG_C4: | 2298 case UIMSG_C4: |
2233 __debugbreak; | 2299 __debugbreak(); |
2234 uGameState = GAME_STATE_PLAYING; | 2300 uGameState = GAME_STATE_PLAYING; |
2235 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | 2301 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); |
2236 goto LABEL_524; | |
2237 case UIMSG_DD: | 2302 case UIMSG_DD: |
2238 LABEL_524: | 2303 __debugbreak(); |
2239 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); | 2304 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); |
2240 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); | 2305 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); |
2241 if ( v216.uPropCount == 1 ) | 2306 if ( v216.uPropCount == 1 ) |
2242 { | 2307 { |
2243 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); | 2308 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); |
2244 v70 = atoi(v216.pProperties[0]); | 2309 v70 = atoi(v216.pProperties[0]); |
2245 if ( v70 <= 0 || v70 >= 77 ) | 2310 if ( v70 <= 0 || v70 >= 77 ) |
2246 { | 2311 { |
2247 //LABEL_90: | |
2248 v1 = ""; | 2312 v1 = ""; |
2249 //LABEL_91: | |
2250 //v0 = 1; | |
2251 continue; | 2313 continue; |
2252 } | 2314 } |
2253 v71 = v70; | 2315 v71 = v70; |
2254 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | 2316 strcpy(Str2, pMapStats->pInfos[v70].pFilename); |
2255 pNPCData3 = 0; | 2317 pNPCData3 = 0; |
2268 { | 2330 { |
2269 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); | 2331 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); |
2270 dword_6BE364_game_settings_1 |= 1u; | 2332 dword_6BE364_game_settings_1 |= 1u; |
2271 uGameState = GAME_STATE_2; | 2333 uGameState = GAME_STATE_2; |
2272 OnMapLeave(); | 2334 OnMapLeave(); |
2273 //goto LABEL_90; | |
2274 v1 = ""; | 2335 v1 = ""; |
2275 //v0 = 1; | |
2276 continue; | 2336 continue; |
2277 } | 2337 } |
2278 } | 2338 } |
2279 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | 2339 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); |
2280 v73 = Str2; | 2340 v73 = Str2; |
2281 } | 2341 } |
2282 else | 2342 else |
2283 { | 2343 { |
2284 if ( v216.uPropCount != 3 ) | 2344 if ( v216.uPropCount != 3 ) |
2285 //goto LABEL_90; | |
2286 { | 2345 { |
2287 v1 = ""; | 2346 v1 = ""; |
2288 //v0 = 1; | |
2289 continue; | 2347 continue; |
2290 } | 2348 } |
2291 v74 = atoi(v216.pProperties[0]); | 2349 v74 = atoi(v216.pProperties[0]); |
2292 thisi = atoi(v216.pProperties[1]); | 2350 thisi = atoi(v216.pProperties[1]); |
2293 v75 = atoi(v216.pProperties[2]); | 2351 v75 = atoi(v216.pProperties[2]); |
2295 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 2353 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
2296 { | 2354 { |
2297 if ( pIndoor->GetSector(v74, thisi, v75) ) | 2355 if ( pIndoor->GetSector(v74, thisi, v75) ) |
2298 { | 2356 { |
2299 v77 = thisi; | 2357 v77 = thisi; |
2300 //LABEL_544: | |
2301 pParty->vPosition.x = v74; | 2358 pParty->vPosition.x = v74; |
2302 pParty->vPosition.y = v77; | 2359 pParty->vPosition.y = v77; |
2303 pParty->vPosition.z = v76; | 2360 pParty->vPosition.z = v76; |
2304 pParty->uFallStartY = v76; | 2361 pParty->uFallStartY = v76; |
2305 //goto LABEL_90; | |
2306 v1 = ""; | 2362 v1 = ""; |
2307 //v0 = 1; | |
2308 continue; | 2363 continue; |
2309 } | 2364 } |
2310 } | 2365 } |
2311 else | 2366 else |
2312 { | 2367 { |
2316 { | 2371 { |
2317 v77 = thisi; | 2372 v77 = thisi; |
2318 if ( thisi > -32768 ) | 2373 if ( thisi > -32768 ) |
2319 { | 2374 { |
2320 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | 2375 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) |
2321 //goto LABEL_544; | |
2322 { | 2376 { |
2323 pParty->vPosition.x = v74; | 2377 pParty->vPosition.x = v74; |
2324 pParty->vPosition.y = v77; | 2378 pParty->vPosition.y = v77; |
2325 pParty->vPosition.z = v76; | 2379 pParty->vPosition.z = v76; |
2326 pParty->uFallStartY = v76; | 2380 pParty->uFallStartY = v76; |
2327 //goto LABEL_90; | |
2328 v1 = ""; | 2381 v1 = ""; |
2329 //v0 = 1; | |
2330 continue; | 2382 continue; |
2331 } | 2383 } |
2332 } | 2384 } |
2333 } | 2385 } |
2334 } | 2386 } |
2335 } | 2387 } |
2336 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 2388 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
2337 v73 = "Can't jump to that location!"; | 2389 v73 = "Can't jump to that location!"; |
2338 } | 2390 } |
2339 ShowStatusBarString(v73, 6u); | 2391 ShowStatusBarString(v73, 6u); |
2340 //goto LABEL_90; | |
2341 v1 = ""; | 2392 v1 = ""; |
2342 //v0 = 1; | |
2343 continue; | 2393 continue; |
2344 case UIMSG_CastQuickSpell: | 2394 case UIMSG_CastQuickSpell: |
2345 if ( bUnderwater == 1 ) | 2395 if ( bUnderwater == 1 ) |
2346 { | 2396 { |
2347 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | 2397 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" |
2348 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | 2398 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2349 continue; | 2399 continue; |
2350 } | 2400 } |
2351 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) | 2401 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) |
2352 //goto LABEL_90; | |
2353 { | 2402 { |
2354 v1 = ""; | 2403 v1 = ""; |
2355 //v0 = 1; | |
2356 continue; | 2404 continue; |
2357 } | 2405 } |
2358 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | 2406 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); |
2359 continue; | 2407 continue; |
2408 case UIMSG_CastSpell_GreatShot://??? | |
2409 __debugbreak(); | |
2360 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, | 2410 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, |
2361 case UIMSG_CastSpell_GreatShot://Fireball, Spraying poison and other | |
2362 if ( pRenderer->pRenderD3D ) | 2411 if ( pRenderer->pRenderD3D ) |
2363 { | 2412 { |
2364 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 2413 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2365 } | 2414 } |
2366 else | 2415 else |
2371 } | 2420 } |
2372 v83 = v81; | 2421 v83 = v81; |
2373 v44 = (unsigned __int16)v81; | 2422 v44 = (unsigned __int16)v81; |
2374 v84 = v83 >> 16; | 2423 v84 = v83 >> 16; |
2375 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | 2424 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
2376 //goto LABEL_90; | |
2377 { | 2425 { |
2378 v1 = ""; | 2426 v1 = ""; |
2379 //v0 = 1; | |
2380 continue; | 2427 continue; |
2381 } | 2428 } |
2382 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 2429 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
2383 if ( uMessage == 70 ) | 2430 if ( uMessage == UIMSG_CastSpell_SmallShot ) |
2384 { | 2431 { |
2385 *((char *)v51 + 8) &= 247; | 2432 LOBYTE(v51->field_8) &= 0xF7; |
2386 } | 2433 } |
2387 else | 2434 else |
2388 { | 2435 { |
2389 if ( uMessage == 140 ) | 2436 if ( uMessage == UIMSG_CastSpell_GreatShot ) |
2390 *((char *)v51 + 9) &= 0xFEu; | 2437 HIBYTE(v51->field_8) &= 0xFEu; |
2391 else | 2438 else |
2392 *((char *)v51 + 9) &= 0xFDu; | 2439 HIBYTE(v51->field_8) &= 0xFDu; |
2393 } | 2440 } |
2394 //goto LABEL_416; | 2441 v51->uPlayerID_2 = uMessageParam; |
2395 *((short *)v51 + 2) = uMessageParam; | 2442 v51->spell_target_pid = v44; |
2396 *((int *)v51 + 3) = v44; | |
2397 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 2443 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); |
2398 pWindow3 = pGUIWindow_Settings; | 2444 pWindow3 = pGUIWindow_Settings; |
2399 pWindow3->Release(); | 2445 pWindow3->Release(); |
2400 pGUIWindow_Settings = 0; | 2446 pGUIWindow_Settings = 0; |
2401 pMouse->SetCursorBitmap("MICON1"); | 2447 pMouse->SetCursorBitmap("MICON1"); |
2402 GameUI_Footer_TimeLeft = 0; | 2448 GameUI_Footer_TimeLeft = 0; |
2403 unk_50C9A0 = 0; | 2449 unk_50C9A0 = 0; |
2404 back_to_game(); | 2450 back_to_game(); |
2405 continue; | 2451 continue; |
2406 case UIMSG_1C: | 2452 case UIMSG_1C: |
2453 __debugbreak(); | |
2407 if ( !uActiveCharacter || pCurrentScreen ) | 2454 if ( !uActiveCharacter || pCurrentScreen ) |
2408 //goto LABEL_90; | |
2409 { | 2455 { |
2410 v1 = ""; | 2456 v1 = ""; |
2411 //v0 = 1; | |
2412 continue; | 2457 continue; |
2413 } | 2458 } |
2414 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); | 2459 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); |
2415 pCurrentScreen = SCREEN_19; | 2460 pCurrentScreen = SCREEN_19; |
2416 pEventTimer->Pause(); | 2461 pEventTimer->Pause(); |
2417 continue; | 2462 continue; |
2418 case UIMSG_1B: | 2463 case UIMSG_1B: |
2464 __debugbreak(); | |
2419 if ( !uActiveCharacter ) | 2465 if ( !uActiveCharacter ) |
2420 //goto LABEL_90; | |
2421 { | 2466 { |
2422 v1 = ""; | 2467 v1 = ""; |
2423 //v0 = 1; | |
2424 continue; | 2468 continue; |
2425 } | 2469 } |
2426 if ( pParty->bTurnBasedModeOn != 1 ) | 2470 if ( pParty->bTurnBasedModeOn != 1 ) |
2427 //goto LABEL_569; | |
2428 { | 2471 { |
2429 if ( pActors[uMessageParam].uAIState == 5 ) | 2472 if ( pActors[uMessageParam].uAIState == 5 ) |
2430 stru_50C198.LootActor(&pActors[uMessageParam]); | 2473 stru_50C198.LootActor(&pActors[uMessageParam]); |
2431 else | 2474 else |
2432 Actor::StealFrom(uMessageParam); | 2475 Actor::StealFrom(uMessageParam); |
2433 continue; | 2476 continue; |
2434 } | 2477 } |
2435 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) | 2478 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) |
2436 //goto LABEL_90; | |
2437 { | 2479 { |
2438 v1 = ""; | 2480 v1 = ""; |
2439 //v0 = 1; | |
2440 continue; | 2481 continue; |
2441 } | 2482 } |
2442 if ( !(pTurnEngine->field_18 & 2) ) | 2483 if ( !(pTurnEngine->field_18 & 2) ) |
2443 { | 2484 { |
2444 //LABEL_569: | |
2445 if ( pActors[uMessageParam].uAIState == 5 ) | 2485 if ( pActors[uMessageParam].uAIState == 5 ) |
2446 stru_50C198.LootActor(&pActors[uMessageParam]); | 2486 stru_50C198.LootActor(&pActors[uMessageParam]); |
2447 else | 2487 else |
2448 Actor::StealFrom(uMessageParam); | 2488 Actor::StealFrom(uMessageParam); |
2449 } | 2489 } |
2450 continue; | 2490 continue; |
2451 | 2491 |
2452 case UIMSG_Attack: | 2492 case UIMSG_Attack: |
2453 if ( !uActiveCharacter ) | 2493 if ( !uActiveCharacter ) |
2454 //goto LABEL_90; | |
2455 { | 2494 { |
2456 v1 = ""; | 2495 v1 = ""; |
2457 //v0 = 1; | |
2458 continue; | 2496 continue; |
2459 } | 2497 } |
2460 if ( pParty->bTurnBasedModeOn != 1 ) | 2498 if ( pParty->bTurnBasedModeOn != 1 ) |
2461 //goto LABEL_577; | |
2462 { | 2499 { |
2463 _42ECB5_PlayerAttacksActor(); | 2500 _42ECB5_PlayerAttacksActor(); |
2464 continue; | 2501 continue; |
2465 } | 2502 } |
2466 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) | 2503 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) |
2467 //goto LABEL_90; | |
2468 { | 2504 { |
2469 v1 = ""; | 2505 v1 = ""; |
2470 //v0 = 1; | |
2471 continue; | 2506 continue; |
2472 } | 2507 } |
2473 if ( !(pTurnEngine->field_18 & 2) ) | 2508 if ( !(pTurnEngine->field_18 & 2) ) |
2474 //LABEL_577: | |
2475 _42ECB5_PlayerAttacksActor(); | 2509 _42ECB5_PlayerAttacksActor(); |
2476 continue; | 2510 continue; |
2477 case UIMSG_ExitRest: | 2511 case UIMSG_ExitRest: |
2478 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" | 2512 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" |
2479 continue; | 2513 continue; |
2533 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | 2567 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" |
2534 ShowStatusBarString(v88, 2); | 2568 ShowStatusBarString(v88, 2); |
2535 if ( !uActiveCharacter ) | 2569 if ( !uActiveCharacter ) |
2536 { | 2570 { |
2537 v1 = ""; | 2571 v1 = ""; |
2538 //v0 = 1; | |
2539 continue; | 2572 continue; |
2540 } | 2573 } |
2541 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | 2574 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2542 continue; | 2575 continue; |
2543 } | 2576 } |
2561 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | 2594 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" |
2562 ShowStatusBarString(v88, 2u); | 2595 ShowStatusBarString(v88, 2u); |
2563 if ( !uActiveCharacter ) | 2596 if ( !uActiveCharacter ) |
2564 { | 2597 { |
2565 v1 = ""; | 2598 v1 = ""; |
2566 //v0 = 1; | |
2567 continue; | 2599 continue; |
2568 } | 2600 } |
2569 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | 2601 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2570 continue; | 2602 continue; |
2571 case UIMSG_Rest8Hour: | 2603 case UIMSG_Rest8Hour: |
2611 Rest(v95 % 6 + 60); | 2643 Rest(v95 % 6 + 60); |
2612 _506F18_num_hours_to_sleep = 0; | 2644 _506F18_num_hours_to_sleep = 0; |
2613 dword_506F14 = 0; | 2645 dword_506F14 = 0; |
2614 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 2646 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
2615 { | 2647 { |
2616 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 2648 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
2617 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 2649 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2618 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2650 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
2619 ++pMessageQueue_50CBD0->uNumMessages; | 2651 ++pMessageQueue_50CBD0->uNumMessages; |
2620 }*/ | 2652 }*/ |
2621 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2653 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
2681 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | 2713 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; |
2682 v161 = pGlobalTXT_LocalizationStrings[486]; | 2714 v161 = pGlobalTXT_LocalizationStrings[486]; |
2683 } | 2715 } |
2684 sprintfex(pTmpBuf, v161, v178); | 2716 sprintfex(pTmpBuf, v161, v178); |
2685 sub_41C0B8_set_status_string(pTmpBuf); | 2717 sub_41C0B8_set_status_string(pTmpBuf); |
2686 //v0 = 1; | |
2687 continue; | 2718 continue; |
2688 case UIMSG_ClickInstallRemoveQuickSpellBtn: | 2719 case UIMSG_ClickInstallRemoveQuickSpellBtn: |
2689 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); | 2720 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); |
2690 if ( !uActiveCharacter ) | 2721 if ( !uActiveCharacter ) |
2691 continue; | 2722 continue; |
2703 if ( uActiveCharacter ) | 2734 if ( uActiveCharacter ) |
2704 pPlayer10->PlaySound(SPEECH_12, 0); | 2735 pPlayer10->PlaySound(SPEECH_12, 0); |
2705 byte_506550 = 0; | 2736 byte_506550 = 0; |
2706 continue; | 2737 continue; |
2707 case UIMSG_33: | 2738 case UIMSG_33: |
2739 __debugbreak(); | |
2708 if ( !uActiveCharacter ) | 2740 if ( !uActiveCharacter ) |
2709 continue; | 2741 continue; |
2710 pPlayer3 = pPlayers[uActiveCharacter]; | 2742 pPlayer3 = pPlayers[uActiveCharacter]; |
2711 pNPCData4 = 0; | 2743 pNPCData4 = 0; |
2712 uAction = 0; | 2744 uAction = 0; |
2800 if ( pTurnEngine->field_4 != 3 ) | 2832 if ( pTurnEngine->field_4 != 3 ) |
2801 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | 2833 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); |
2802 continue; | 2834 continue; |
2803 | 2835 |
2804 case UIMSG_92: | 2836 case UIMSG_92: |
2837 __debugbreak(); | |
2805 if ( pTurnEngine->field_4 != 3 ) | 2838 if ( pTurnEngine->field_4 != 3 ) |
2806 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); | 2839 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); |
2807 continue; | 2840 continue; |
2808 case UIMSG_SpellBookWindow: | 2841 case UIMSG_SpellBookWindow: |
2809 if ( pTurnEngine->field_4 == 3 ) | 2842 if ( pTurnEngine->field_4 == 3 ) |
2818 if ( pMessageQueue_50CBD0->uNumMessages ) | 2851 if ( pMessageQueue_50CBD0->uNumMessages ) |
2819 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 2852 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
2820 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | 2853 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) |
2821 { | 2854 { |
2822 if ( !pCurrentScreen ) | 2855 if ( !pCurrentScreen ) |
2823 //goto LABEL_693; | |
2824 { | 2856 { |
2825 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); | 2857 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
2826 pCurrentScreen = SCREEN_SPELL_BOOK; | 2858 pCurrentScreen = SCREEN_SPELL_BOOK; |
2827 pEventTimer->Pause(); | 2859 pEventTimer->Pause(); |
2828 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); | 2860 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); |
2881 stru_506E40._40E55E("gamma.pcx", 0); | 2913 stru_506E40._40E55E("gamma.pcx", 0); |
2882 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); | 2914 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
2883 //LABEL_453: | 2915 //LABEL_453: |
2884 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 2916 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
2885 continue; | 2917 continue; |
2886 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 2918 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
2887 //goto LABEL_770; | 2919 //goto LABEL_770; |
2888 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 2920 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2889 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2921 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
2890 ++pMessageQueue_50CBD0->uNumMessages;*/ | 2922 ++pMessageQueue_50CBD0->uNumMessages;*/ |
2891 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2923 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
2892 continue; | 2924 continue; |
2893 case UIMSG_C0: | 2925 case UIMSG_C0: |
2926 __debugbreak(); | |
2894 dword_50651C = 1; | 2927 dword_50651C = 1; |
2895 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | 2928 if ( pMouse->GetCursorPos(&v211)->y > 178 ) |
2896 dword_50651C = -1; | 2929 dword_50651C = -1; |
2897 continue; | 2930 continue; |
2898 case UIMSG_ClickAwardsUpBtn: | 2931 case UIMSG_ClickAwardsUpBtn: |
2899 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); | 2932 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); |
2900 dword_506548 = 1; | 2933 BtnUp_flag = 1; |
2901 continue; | 2934 continue; |
2902 case UIMSG_ClickAwardsDownBtn: | 2935 case UIMSG_ClickAwardsDownBtn: |
2903 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); | 2936 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); |
2904 dword_506544 = 1; | 2937 BtnDown_flag = 1; |
2905 continue; | 2938 continue; |
2906 case UIMSG_ChangeDetaliz: | 2939 case UIMSG_ChangeDetaliz: |
2907 bRingsShownInCharScreen ^= 1; | 2940 bRingsShownInCharScreen ^= 1; |
2908 pCharacterScreen_DetalizBtn->Release(); | 2941 pCharacterScreen_DetalizBtn->Release(); |
2909 pCharacterScreen_DollBtn->Release(); | 2942 pCharacterScreen_DollBtn->Release(); |
2981 sub_419220(); | 3014 sub_419220(); |
2982 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | 3015 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; |
2983 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); | 3016 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); |
2984 FillAwardsData(); | 3017 FillAwardsData(); |
2985 continue; | 3018 continue; |
2986 case UIMSG_AutonotesBook: | 3019 case UIMSG_AutonotesBook://не только Автозаметки (в процессе) |
2987 switch ( uMessageParam ) | 3020 switch ( uMessageParam ) |
2988 { | 3021 { |
2989 default: | 3022 case 11://Page UP |
2990 continue; | 3023 BtnUp_flag = 1; |
2991 case 11: | 3024 pButton = pBtn_Book_2; |
2992 dword_506548 = 1; | 3025 break; |
2993 continue; | 3026 case 10://Page DOWN |
2994 case 10: | 3027 BtnDown_flag = 1; |
2995 dword_506544 = 1; | 3028 pButton = pBtn_Book_1; |
2996 continue; | 3029 break; |
2997 case 0: | 3030 case 0: |
2998 pButton = pBtn_Book_1; | 3031 pButton = pBtn_Book_1; |
2999 dword_506544 = 1; | 3032 BtnDown_flag = 1; |
3000 break; | 3033 break; |
3001 case 1: | 3034 case 1: |
3002 pButton = pBtn_Book_2; | 3035 pButton = pBtn_Book_2;//увеличить в MapsBook |
3003 dword_506548 = 1; | 3036 BtnUp_flag = 1; |
3004 break; | 3037 break; |
3005 case 2: | 3038 case 2://Potions |
3006 dword_506540 = 1; | 3039 Book_PageBtn3_flag = 1; |
3007 if ( dword_506364 ) | 3040 if ( dword_506364 ) |
3008 continue; | 3041 continue; |
3009 pButton = pBtn_Book_3; | 3042 pButton = pBtn_Book_3; |
3010 break; | 3043 break; |
3011 case 3: | 3044 case 3://fountains |
3012 dword_50653C = 1; | 3045 Book_PageBtn4_flag = 1; |
3013 if ( dword_506364 ) | 3046 if ( dword_506364 ) |
3014 continue; | 3047 continue; |
3015 pButton = pBtn_Book_4; | 3048 pButton = pBtn_Book_4; |
3016 break; | 3049 break; |
3017 case 4: | 3050 case 4://obelisks |
3018 dword_506538 = 1; | 3051 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag |
3019 if ( dword_506364 ) | 3052 if ( dword_506364 ) |
3020 continue; | 3053 continue; |
3021 pButton = pBtn_Book_5; | 3054 pButton = pBtn_Book_5; |
3022 break; | 3055 break; |
3023 case 5: | 3056 case 5://seer |
3024 dword_506534 = 1; | 3057 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag |
3025 if ( dword_506364 ) | 3058 if ( dword_506364 ) |
3026 continue; | 3059 continue; |
3027 pButton = pBtn_Book_6; | 3060 pButton = pBtn_Book_6; |
3028 break; | 3061 break; |
3029 case 6: | 3062 case 6://misc |
3030 pButton = pBtn_Autonotes_Misc; | 3063 pButton = pBtn_Autonotes_Misc; |
3031 dword_506530 = 1; | 3064 Autonotes_Misc_page_flag = 1; |
3032 break; | 3065 break; |
3033 case 7: | 3066 case 7://Instructors |
3034 pButton = pBtn_Autonotes_Instructors; | 3067 pButton = pBtn_Autonotes_Instructors; |
3035 dword_50652C = 1; | 3068 Autonotes_Instructors_page_flag = 1; |
3036 break; | 3069 break; |
3070 default: | |
3071 continue; | |
3037 } | 3072 } |
3038 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); | 3073 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); |
3039 continue; | 3074 continue; |
3040 case UIMSG_SelectCharacter: | 3075 case UIMSG_SelectCharacter: |
3041 if ( pMessageQueue_50CBD0->uNumMessages ) | 3076 if ( pMessageQueue_50CBD0->uNumMessages ) |
3088 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" | 3123 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" |
3089 v114 = v110->GetMaxHealth(); | 3124 v114 = v110->GetMaxHealth(); |
3090 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); | 3125 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); |
3091 sub_41C0B8_set_status_string(pTmpBuf); | 3126 sub_41C0B8_set_status_string(pTmpBuf); |
3092 continue; | 3127 continue; |
3093 case UIMSG_C: | 3128 case UIMSG_CHEST_ClickItem: |
3094 if ( pCurrentScreen == SCREEN_F ) | 3129 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) |
3095 { | 3130 { |
3096 sub_421EA6_OnInventoryLeftClick(); | 3131 OnInventoryLeftClick(); |
3097 continue; | 3132 continue; |
3098 } | 3133 } |
3099 sub_420E01(); | 3134 OnChestLeftClick(); |
3100 continue; | 3135 continue; |
3101 case UIMSG_InventoryLeftClick: | 3136 case UIMSG_InventoryLeftClick: |
3102 sub_421EA6_OnInventoryLeftClick(); | 3137 OnInventoryLeftClick(); |
3103 continue; | 3138 continue; |
3104 case UIMSG_MouseLeftClickInGame: | 3139 case UIMSG_MouseLeftClickInGame: |
3105 if ( !pRenderer->pRenderD3D ) | 3140 if ( !pRenderer->pRenderD3D ) |
3106 { | 3141 { |
3107 if ( pMessageQueue_50CBD0->uNumMessages ) | 3142 if ( pMessageQueue_50CBD0->uNumMessages ) |
3111 } | 3146 } |
3112 v115 = pMessageQueue_50CBD0->uNumMessages; | 3147 v115 = pMessageQueue_50CBD0->uNumMessages; |
3113 if ( !pMessageQueue_50CBD0->uNumMessages ) | 3148 if ( !pMessageQueue_50CBD0->uNumMessages ) |
3114 //goto LABEL_768; | 3149 //goto LABEL_768; |
3115 { | 3150 { |
3116 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0); | 3151 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
3117 /*if ( (signed int)v115 < 40 ) | 3152 /*if ( (signed int)v115 < 40 ) |
3118 //goto LABEL_769; | 3153 //goto LABEL_769; |
3119 { | 3154 { |
3120 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; | 3155 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
3121 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 3156 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3122 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3157 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3123 ++pMessageQueue_50CBD0->uNumMessages; | 3158 ++pMessageQueue_50CBD0->uNumMessages; |
3124 continue; | 3159 continue; |
3125 }*/ | 3160 }*/ |
3126 continue; | 3161 continue; |
3127 } | 3162 } |
3128 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | 3163 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
3129 { | 3164 { |
3130 pMessageQueue_50CBD0->uNumMessages = 1; | 3165 pMessageQueue_50CBD0->uNumMessages = 1; |
3131 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0); | 3166 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
3132 /*v115 = v0; | 3167 /*v115 = v0; |
3133 pMessageQueue_50CBD0->uNumMessages = v0; | 3168 pMessageQueue_50CBD0->uNumMessages = v0; |
3134 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; | 3169 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
3135 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 3170 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3136 //goto LABEL_771; | 3171 //goto LABEL_771; |
3137 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3172 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3138 ++pMessageQueue_50CBD0->uNumMessages;*/ | 3173 ++pMessageQueue_50CBD0->uNumMessages;*/ |
3139 continue; | 3174 continue; |
3140 } | 3175 } |
3141 v115 = 0; | 3176 v115 = 0; |
3142 pMessageQueue_50CBD0->uNumMessages = 0; | 3177 pMessageQueue_50CBD0->uNumMessages = 0; |
3143 pMessageQueue_50CBD0->AddMessage(UIMSG_E, 0, 0); | 3178 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
3144 /*if ( (signed int)v115 < 40 ) | 3179 /*if ( (signed int)v115 < 40 ) |
3145 //goto LABEL_769; | 3180 //goto LABEL_769; |
3146 { | 3181 { |
3147 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; | 3182 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
3148 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 3183 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3149 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3184 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3150 ++pMessageQueue_50CBD0->uNumMessages; | 3185 ++pMessageQueue_50CBD0->uNumMessages; |
3151 continue; | 3186 continue; |
3152 }*/ | 3187 }*/ |
3153 continue; | 3188 continue; |
3154 case UIMSG_E://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame | 3189 case UIMSG_MouseLeftClickInScreen://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame |
3155 if ( pMessageQueue_50CBD0->uNumMessages ) | 3190 if ( pMessageQueue_50CBD0->uNumMessages ) |
3156 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3191 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3157 OnGameViewportClick(); | 3192 OnGameViewportClick(); |
3158 continue; | 3193 continue; |
3159 case UIMSG_F: | 3194 case UIMSG_F: |
3195 __debugbreak(); | |
3160 if ( pRenderer->pRenderD3D ) | 3196 if ( pRenderer->pRenderD3D ) |
3161 { | 3197 { |
3162 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | 3198 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
3163 } | 3199 } |
3164 else | 3200 else |
3169 } | 3205 } |
3170 pButton2 = (GUIButton *)(unsigned __int16)v116; | 3206 pButton2 = (GUIButton *)(unsigned __int16)v116; |
3171 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); | 3207 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); |
3172 continue; | 3208 continue; |
3173 case UIMSG_54: | 3209 case UIMSG_54: |
3210 __debugbreak(); | |
3174 pButton2 = (GUIButton *)uMessageParam; | 3211 pButton2 = (GUIButton *)uMessageParam; |
3175 GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); | 3212 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); |
3176 continue; | 3213 continue; |
3177 case UIMSG_Game_Action: | 3214 case UIMSG_Game_Action: |
3178 if ( pMessageQueue_50CBD0->uNumMessages ) | 3215 if ( pMessageQueue_50CBD0->uNumMessages ) |
3179 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3216 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3180 OnPressSpace(); | 3217 OnPressSpace(); |
10276 { | 10313 { |
10277 if ( pCurrentScreen == SCREEN_CHEST ) | 10314 if ( pCurrentScreen == SCREEN_CHEST ) |
10278 { | 10315 { |
10279 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); | 10316 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); |
10280 } | 10317 } |
10281 else if ( pCurrentScreen == SCREEN_F ) | 10318 else if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) |
10282 { | 10319 { |
10283 pRenderer->ClearZBuffer(0, 479); | 10320 pRenderer->ClearZBuffer(0, 479); |
10284 draw_leather(); | 10321 draw_leather(); |
10285 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 10322 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
10286 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | 10323 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); |
10892 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); | 10929 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
10893 | 10930 |
10894 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10931 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10895 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 10932 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
10896 { | 10933 { |
10897 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 10934 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
10898 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 10935 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
10899 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 10936 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
10900 ++pMessageQueue_50CBD0->uNumMessages; | 10937 ++pMessageQueue_50CBD0->uNumMessages; |
10901 }*/ | 10938 }*/ |
10902 v42 = (int *)&a2.y; | 10939 v42 = (int *)&a2.y; |
10968 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); | 11005 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
10969 | 11006 |
10970 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 11007 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10971 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 11008 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
10972 { | 11009 { |
10973 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 11010 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
10974 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 11011 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
10975 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 11012 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
10976 ++pMessageQueue_50CBD0->uNumMessages; | 11013 ++pMessageQueue_50CBD0->uNumMessages; |
10977 }*/ | 11014 }*/ |
10978 v42 = (int *)&a2.y; | 11015 v42 = (int *)&a2.y; |
11284 && pPlayers[uActiveCharacter]->CanAct() | 11321 && pPlayers[uActiveCharacter]->CanAct() |
11285 && pPlayers[uActiveCharacter]->CanSteal() ) | 11322 && pPlayers[uActiveCharacter]->CanSteal() ) |
11286 { | 11323 { |
11287 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 11324 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
11288 { | 11325 { |
11289 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)27; | 11326 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_1B; |
11290 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3; | 11327 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3; |
11291 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 11328 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
11292 ++pMessageQueue_50CBD0->uNumMessages; | 11329 ++pMessageQueue_50CBD0->uNumMessages; |
11293 }*/ | 11330 }*/ |
11294 pMessageQueue_50CBD0->AddMessage(UIMSG_1B, PID_ID(v6), 0); | 11331 pMessageQueue_50CBD0->AddMessage(UIMSG_1B, PID_ID(v6), 0); |