comparison mm7_5.cpp @ 11:66319a734368

16.01.13(work)
author Ritor1
date Wed, 16 Jan 2013 17:31:56 +0600
parents 8e33efd39355
children b4982f23d2e9 2127707df23f
comparison
equal deleted inserted replaced
10:40f6ac8fbe39 11:66319a734368
457 pGUIWindow_CurrentMenu->Release(); 457 pGUIWindow_CurrentMenu->Release();
458 pCurrentScreen = 2; 458 pCurrentScreen = 2;
459 v162 = 0; 459 v162 = 0;
460 v148 = 0; 460 v148 = 0;
461 pWindowType = (WindowType)8; 461 pWindowType = (WindowType)8;
462 goto LABEL_439; 462 //goto LABEL_439;
463 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162);
464 continue;
463 case UIMSG_ArrowUp: 465 case UIMSG_ArrowUp:
464 --pSaveListPosition; 466 --pSaveListPosition;
465 if ( pSaveListPosition < 0 ) 467 if ( pSaveListPosition < 0 )
466 pSaveListPosition = 0; 468 pSaveListPosition = 0;
467 v163 = 0; 469 v163 = 0;
470 //goto LABEL_60; 472 //goto LABEL_60;
471 pWindowType1 = (WindowType)90; 473 pWindowType1 = (WindowType)90;
472 v137 = 17; 474 v137 = 17;
473 v133 = 17; 475 v133 = 17;
474 v9 = 215; 476 v9 = 215;
475 goto LABEL_733; 477 //goto LABEL_733;
478 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
479 continue;
476 case UIMSG_DownArrow: 480 case UIMSG_DownArrow:
477 ++pSaveListPosition; 481 ++pSaveListPosition;
478 if ( pSaveListPosition >= uMessageParam ) 482 if ( pSaveListPosition >= uMessageParam )
479 pSaveListPosition = uMessageParam - 1; 483 pSaveListPosition = uMessageParam - 1;
480 v163 = 0; 484 v163 = 0;
483 //LABEL_60: 487 //LABEL_60:
484 pWindowType1 = (WindowType)90; 488 pWindowType1 = (WindowType)90;
485 v137 = 17; 489 v137 = 17;
486 v133 = 17; 490 v133 = 17;
487 v9 = 215; 491 v9 = 215;
488 goto LABEL_733; 492 //goto LABEL_733;
493 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
494 continue;
489 case UIMSG_Cancel: 495 case UIMSG_Cancel:
490 v163 = 0; 496 v163 = 0;
491 v8 = 302; 497 v8 = 302;
492 pButton2 = pBtnCancel; 498 pButton2 = pBtnCancel;
493 v9 = 350; 499 v9 = 350;
494 pWindowType1 = (WindowType)96; 500 pWindowType1 = (WindowType)96;
495 v137 = 42; 501 v137 = 42;
496 v133 = 106; 502 v133 = 106;
497 goto LABEL_733; 503 //goto LABEL_733;
504 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
505 continue;
498 case UIMSG_LoadSlot: 506 case UIMSG_LoadSlot:
499 v163 = 0; 507 v163 = 0;
500 v8 = 302; 508 v8 = 302;
501 pButton2 = pBtnLoadSlot; 509 pButton2 = pBtnLoadSlot;
502 v9 = 241; 510 v9 = 241;
503 pWindowType1 = (WindowType)94; 511 pWindowType1 = (WindowType)94;
504 v137 = 42; 512 v137 = 42;
505 v133 = 106; 513 v133 = 106;
506 goto LABEL_733; 514 //goto LABEL_733;
515 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
516 continue;
507 case UIMSG_SelectLoadSlot: 517 case UIMSG_SelectLoadSlot:
508 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 518 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
509 pKeyActionMap->_459ED1(0); 519 pKeyActionMap->_459ED1(0);
510 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) 520 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
511 { 521 {
689 dword_506E68 = -1; 699 dword_506E68 = -1;
690 dword_506F08 = 1; 700 dword_506F08 = 1;
691 memset(word_506E6C, 0, 0x1Cu); 701 memset(word_506E6C, 0, 0x1Cu);
692 word_506E6C[14] = 0; 702 word_506E6C[14] = 0;
693 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); 703 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
694 goto LABEL_90; 704 //goto LABEL_90;
705 v1 = "";
706 v0 = 1;
707 continue;
695 //default: 708 //default:
696 //continue; 709 //continue;
697 case UIMSG_ResetKeyMapping|0x1: 710 case UIMSG_ResetKeyMapping|0x1:
698 if ( dword_506E68 != -1 ) 711 if ( dword_506E68 != -1 )
699 goto LABEL_623; 712 goto LABEL_623;
806 continue; 819 continue;
807 case UIMSG_ToggleTint|0x1: 820 case UIMSG_ToggleTint|0x1:
808 if ( uMessageParam == 4 ) 821 if ( uMessageParam == 4 )
809 { 822 {
810 --uGammaPos; 823 --uGammaPos;
811 if ( (uGammaPos /*& 0x80000000u*/) != 0 ) 824 if ( (uGammaPos & 0x80000000u) != 0 )
812 { 825 {
813 uGammaPos = 0; 826 uGammaPos = 0;
814 //goto LABEL_128; 827 //goto LABEL_128;
815 v165 = 0; 828 v165 = 0;
816 v151 = 0; 829 v151 = 0;
1184 if ( pCurrentScreen >= 17 && (pCurrentScreen <= 18 || pCurrentScreen == 104) ) 1197 if ( pCurrentScreen >= 17 && (pCurrentScreen <= 18 || pCurrentScreen == 104) )
1185 { 1198 {
1186 //LABEL_229: 1199 //LABEL_229:
1187 if ( dword_50CDC8 ) 1200 if ( dword_50CDC8 )
1188 goto LABEL_232; 1201 goto LABEL_232;
1189 sub_42FC15(); 1202 CloseWindowBackground();
1190 //goto LABEL_231; 1203 //goto LABEL_231;
1191 uMessageParam = v0; 1204 uMessageParam = v0;
1192 goto LABEL_232; 1205 goto LABEL_232;
1193 } 1206 }
1194 } 1207 }
1196 { 1209 {
1197 if ( pCurrentScreen >= 14 || pCurrentScreen == 4 || pCurrentScreen == 10 ) 1210 if ( pCurrentScreen >= 14 || pCurrentScreen == 4 || pCurrentScreen == 10 )
1198 //goto LABEL_229; 1211 //goto LABEL_229;
1199 if ( dword_50CDC8 ) 1212 if ( dword_50CDC8 )
1200 goto LABEL_232; 1213 goto LABEL_232;
1201 sub_42FC15(); 1214 CloseWindowBackground();
1202 //goto LABEL_231; 1215 //goto LABEL_231;
1203 uMessageParam = v0; 1216 uMessageParam = v0;
1204 goto LABEL_232; 1217 goto LABEL_232;
1205 if ( pCurrentScreen == 13 && !dword_50CDC8 && !dword_5C35C8 ) 1218 if ( pCurrentScreen == 13 && !dword_50CDC8 && !dword_5C35C8 )
1206 { 1219 {
1207 sub_42FC15(); 1220 CloseWindowBackground();
1208 dword_5C35C8 = 0; 1221 dword_5C35C8 = 0;
1209 //LABEL_231: 1222 //LABEL_231:
1210 uMessageParam = v0; 1223 uMessageParam = v0;
1211 goto LABEL_232; 1224 goto LABEL_232;
1212 } 1225 }
1749 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 1762 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
1750 free((void *)uNumSeconds); 1763 free((void *)uNumSeconds);
1751 stru_506E40._40E55E("gamma.pcx", 0); 1764 stru_506E40._40E55E("gamma.pcx", 0);
1752 continue; 1765 continue;
1753 } 1766 }
1754 goto LABEL_333; 1767 //goto LABEL_333;
1768 pWindow3->Release();
1769 pGUIWindow_Settings = 0;
1770 pMouse->SetCursorBitmap("MICON1");
1771 GameUI_StatusBar_TimedStringTimeLeft = 0;
1772 unk_50C9A0 = 0;
1773 back_to_game();
1774 continue;
1755 } 1775 }
1756 sub_41426F(); 1776 sub_41426F();
1757 //_continue:
1758 continue; 1777 continue;
1759 case UIMSG_BC: 1778 case UIMSG_BC:
1760 if ( uMessageParam ) 1779 if ( uMessageParam )
1761 { 1780 {
1762 GUIWindow::Create(0x272u, 0xB3u, 0, 0, (enum WindowType)90, (int)pBtn_NPCRight, 0); 1781 GUIWindow::Create(0x272u, 0xB3u, 0, 0, (enum WindowType)90, (int)pBtn_NPCRight, 0);
1840 dword_597F18 = 0; 1859 dword_597F18 = 0;
1841 if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) 1860 if ( !_strcmpi(byte_6BE3B0, "d05.blv") )
1842 pParty->uTimePlayed += 1474560i64; 1861 pParty->uTimePlayed += 1474560i64;
1843 continue; 1862 continue;
1844 case 0x19C: 1863 case 0x19C:
1845 sub_42FC15(); 1864 CloseWindowBackground();
1846 pVideoPlayer->Unload(); 1865 pVideoPlayer->Unload();
1847 sub_44603D(); 1866 sub_44603D();
1848 dword_597F18 = 0; 1867 dword_597F18 = 0;
1849 goto LABEL_422; 1868 goto LABEL_422;
1850 case UIMSG_CycleCharacters: 1869 case UIMSG_CycleCharacters:
1861 if ( bUnderwater != 1 && pParty->bFlying 1880 if ( bUnderwater != 1 && pParty->bFlying
1862 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, &pOut, 20) != v0 ) 1881 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, &pOut, 20) != v0 )
1863 { 1882 {
1864 viewparams->bRedrawGameUI = v0; 1883 viewparams->bRedrawGameUI = v0;
1865 LABEL_387: 1884 LABEL_387:
1866 sub_42FC15(); 1885 CloseWindowBackground();
1867 if ( pParty->vPosition.x < -22528 ) 1886 if ( pParty->vPosition.x < -22528 )
1868 pParty->vPosition.x = -22528; 1887 pParty->vPosition.x = -22528;
1869 if ( pParty->vPosition.x > 22528 ) 1888 if ( pParty->vPosition.x > 22528 )
1870 pParty->vPosition.x = 22528; 1889 pParty->vPosition.x = 22528;
1871 if ( pParty->vPosition.y < -22528 ) 1890 if ( pParty->vPosition.y < -22528 )
1969 uNumSeconds = v44; 1988 uNumSeconds = v44;
1970 v46 = v44 >> 3; 1989 v46 = v44 >> 3;
1971 if ( v45 == 3 ) 1990 if ( v45 == 3 )
1972 { 1991 {
1973 v47 = pActors[v46].uAIState == Dead; 1992 v47 = pActors[v46].uAIState == Dead;
1974 goto LABEL_400; 1993 //goto LABEL_400;
1975 }
1976 if ( v45 == 2 )
1977 {
1978 v47 = (pObjectList->pObjects[pLayingItems[v46].uObjectDescID].uFlags & 0x10) == 0;
1979 LABEL_400:
1980 if ( !v47 ) 1994 if ( !v47 )
1981 continue; 1995 continue;
1982 goto LABEL_415; 1996 //goto LABEL_415;
1997 v51 = pGUIWindow_Settings->ptr_1C;
1998 *((char *)v51 + 8) &= 0xBFu;
1999 *((short *)v51 + 2) = uMessageParam;
2000 *((int *)v51 + 3) = v44;
2001 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2002 pWindow3 = pGUIWindow_Settings;
2003 pWindow3->Release();
2004 pGUIWindow_Settings = 0;
2005 pMouse->SetCursorBitmap("MICON1");
2006 GameUI_StatusBar_TimedStringTimeLeft = 0;
2007 unk_50C9A0 = 0;
2008 back_to_game();
2009 continue;
2010 }
2011 if ( v45 == 2 )
2012 {
2013 v47 = (pObjectList->pObjects[pLayingItems[v46].uObjectDescID].uFlags & 0x10) == 0;
2014 //LABEL_400:
2015 if ( !v47 )
2016 continue;
2017 //goto LABEL_415;
2018 v51 = pGUIWindow_Settings->ptr_1C;
2019 *((char *)v51 + 8) &= 0xBFu;
2020 *((short *)v51 + 2) = uMessageParam;
2021 *((int *)v51 + 3) = v44;
2022 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2023 pWindow3 = pGUIWindow_Settings;
2024 pWindow3->Release();
2025 pGUIWindow_Settings = 0;
2026 pMouse->SetCursorBitmap("MICON1");
2027 GameUI_StatusBar_TimedStringTimeLeft = 0;
2028 unk_50C9A0 = 0;
2029 back_to_game();
2030 continue;
1983 } 2031 }
1984 if ( v45 == 5 ) 2032 if ( v45 == 5 )
1985 { 2033 {
1986 v48 = pLevelDecorations[v46].field_16_event_id == 0; 2034 v48 = pLevelDecorations[v46].field_16_event_id == 0;
1987 } 2035 }
1993 { 2041 {
1994 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; 2042 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
1995 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) 2043 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID )
1996 continue; 2044 continue;
1997 v44 = uNumSeconds; 2045 v44 = uNumSeconds;
1998 goto LABEL_415; 2046 //goto LABEL_415;
2047 v51 = pGUIWindow_Settings->ptr_1C;
2048 *((char *)v51 + 8) &= 0xBFu;
2049 *((short *)v51 + 2) = uMessageParam;
2050 *((int *)v51 + 3) = v44;
2051 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2052 pWindow3 = pGUIWindow_Settings;
2053 pWindow3->Release();
2054 pGUIWindow_Settings = 0;
2055 pMouse->SetCursorBitmap("MICON1");
2056 GameUI_StatusBar_TimedStringTimeLeft = 0;
2057 unk_50C9A0 = 0;
2058 back_to_game();
2059 continue;
1999 } 2060 }
2000 pBLVFace = &pIndoor->pFaces[v46]; 2061 pBLVFace = &pIndoor->pFaces[v46];
2001 if ( !(BYTE3(pBLVFace->uAttributes) & 2) ) 2062 if ( !(BYTE3(pBLVFace->uAttributes) & 2) )
2002 continue; 2063 continue;
2003 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; 2064 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
2004 } 2065 }
2005 if ( v48 ) 2066 if ( v48 )
2006 continue; 2067 continue;
2007 LABEL_415: 2068 //LABEL_415:
2008 v51 = pGUIWindow_Settings->ptr_1C; 2069 v51 = pGUIWindow_Settings->ptr_1C;
2009 *((char *)v51 + 8) &= 0xBFu; 2070 *((char *)v51 + 8) &= 0xBFu;
2010 LABEL_416: 2071 //LABEL_416:
2011 *((short *)v51 + 2) = uMessageParam; 2072 *((short *)v51 + 2) = uMessageParam;
2012 *((int *)v51 + 3) = v44; 2073 *((int *)v51 + 3) = v44;
2013 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); 2074 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2014 pWindow3 = pGUIWindow_Settings; 2075 pWindow3 = pGUIWindow_Settings;
2015 LABEL_333: 2076 //LABEL_333:
2016 pWindow3->Release(); 2077 pWindow3->Release();
2017 pGUIWindow_Settings = 0; 2078 pGUIWindow_Settings = 0;
2018 pMouse->SetCursorBitmap("MICON1"); 2079 pMouse->SetCursorBitmap("MICON1");
2019 GameUI_StatusBar_TimedStringTimeLeft = 0; 2080 GameUI_StatusBar_TimedStringTimeLeft = 0;
2020 unk_50C9A0 = 0; 2081 unk_50C9A0 = 0;
2066 sub_42FBDD(); 2127 sub_42FBDD();
2067 SaveGame(v0, 0); 2128 SaveGame(v0, 0);
2068 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); 2129 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
2069 dword_6BE364_game_settings_1 |= v0; 2130 dword_6BE364_game_settings_1 |= v0;
2070 uGameState = 2; 2131 uGameState = 2;
2071 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; 2132 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
2072 v53 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1]._quest_related; 2133 v53 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1]._quest_related;
2073 if ( v53 < 0 ) 2134 if ( v53 < 0 )
2074 { 2135 {
2075 v54 = abs(v53) - 1; 2136 v54 = abs(v53) - 1;
2076 _5B65B8_npcdata_hiword_house_or_other = 0; 2137 _5B65B8_npcdata_hiword_house_or_other = 0;
2083 _5B65B4_npcdata_loword_house_or_other = v57; 2144 _5B65B4_npcdata_loword_house_or_other = v57;
2084 _5B65B0_npcdata_rep_or_other = v56; 2145 _5B65B0_npcdata_rep_or_other = v56;
2085 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; 2146 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
2086 } 2147 }
2087 sub_4BD8B5(); 2148 sub_4BD8B5();
2088 goto LABEL_434; 2149 //goto LABEL_434;
2150 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2151 {
2152 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2153 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
2154 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2155 ++pMessageQueue_50CBD0->uNumMessages;
2156 }
2157 continue;
2089 case UIMSG_C3: 2158 case UIMSG_C3:
2090 pAudioPlayer->StopChannels(-1, -1); 2159 pAudioPlayer->StopChannels(-1, -1);
2091 v162 = uMessageParam; 2160 v162 = uMessageParam;
2092 v148 = 195; 2161 v148 = 195;
2093 goto LABEL_438; 2162 //goto LABEL_438;
2163 pWindowType = (WindowType)9;
2164 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162);
2165 continue;
2094 case UIMSG_B1: 2166 case UIMSG_B1:
2095 pAudioPlayer->StopChannels(-1, -1); 2167 pAudioPlayer->StopChannels(-1, -1);
2096 v162 = 0; 2168 v162 = 0;
2097 v148 = 177; 2169 v148 = 177;
2098 LABEL_438: 2170 //LABEL_438:
2099 pWindowType = (WindowType)9; 2171 pWindowType = (WindowType)9;
2100 LABEL_439: 2172 //LABEL_439:
2101 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162); 2173 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162);
2102 continue; 2174 continue;
2103 case UIMSG_B2: 2175 case UIMSG_B2:
2104 v165 = 0; 2176 v165 = 0;
2105 v151 = 0; 2177 v151 = 0;
2135 goto _sprintex_2args_draw_status_and_continue; 2207 goto _sprintex_2args_draw_status_and_continue;
2136 } 2208 }
2137 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; 2209 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
2138 v158 = (unsigned int)thise; 2210 v158 = (unsigned int)thise;
2139 v146 = pGlobalTXT_LocalizationStrings[475];// "Set %s over %s" 2211 v146 = pGlobalTXT_LocalizationStrings[475];// "Set %s over %s"
2140 _sprintex_draw_status_and_continue: 2212 //_sprintex_draw_status_and_continue:
2141 sprintf(pTmpBuf, v146, v158, v174); 2213 sprintf(pTmpBuf, v146, v158, v174);
2142 goto _set_status_string_pTmpBuf_and_continue; 2214 sub_41C0B8_set_status_string(pTmpBuf);
2215 continue;
2143 case UIMSG_B5: 2216 case UIMSG_B5:
2144 dword_50CDC8 = v0; 2217 dword_50CDC8 = v0;
2145 goto LABEL_453; 2218 //goto LABEL_453;
2219 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
2220 continue;
2221 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2222 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
2223 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2224 ++pMessageQueue_50CBD0->uNumMessages;
2225 continue;
2146 case UIMSG_B3: 2226 case UIMSG_B3:
2147 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; 2227 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
2148 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; 2228 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam];
2149 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) 2229 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon )
2150 continue; 2230 continue;
2281 v67 = pGUIWindow_CurrentMenu->Hint; 2361 v67 = pGUIWindow_CurrentMenu->Hint;
2282 if ( v67 ) 2362 if ( v67 )
2283 *((int *)v67 + 17) = v0; 2363 *((int *)v67 + 17) = v0;
2284 else 2364 else
2285 pParty->pPlayers[(unsigned __int8)byte_50C0C0].CanCastSpell(0x14u); 2365 pParty->pPlayers[(unsigned __int8)byte_50C0C0].CanCastSpell(0x14u);
2286 LABEL_434: 2366 //LABEL_434:
2287 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 2367 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
2288 { 2368 {
2289 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 2369 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2290 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; 2370 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
2291 LABEL_771: 2371 //LABEL_771:
2292 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 2372 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
2293 ++pMessageQueue_50CBD0->uNumMessages; 2373 ++pMessageQueue_50CBD0->uNumMessages;
2294 } 2374 }
2295 continue; 2375 continue;
2296 } 2376 }
2322 case 4: 2402 case 4:
2323 v68 = 209; 2403 v68 = 209;
2324 break; 2404 break;
2325 default: 2405 default:
2326 if ( uMessageParam != 5 ) 2406 if ( uMessageParam != 5 )
2327 goto LABEL_506; 2407 //goto LABEL_506;
2328 v68 = 210; 2408 {
2329 break; 2409 if ( uMessageParam )
2410 {
2411 switch ( uMessageParam )
2412 {
2413 case 1:
2414 v69 = pMapStats->pInfos[4].pName;
2415 break;
2416 case 2:
2417 v69 = pMapStats->pInfos[3].pName;
2418 break;
2419 case 3:
2420 v69 = pMapStats->pInfos[10].pName;
2421 break;
2422 case 4:
2423 v69 = pMapStats->pInfos[7].pName;
2424 break;
2425 default:
2426 if ( uMessageParam != 5 )
2427 {
2428 v173 = v200;
2429 v157 = pGlobalTXT_LocalizationStrings[35];
2430 goto _sprintex_2args_draw_status_and_continue;
2431 }
2432 v69 = pMapStats->pInfos[8].pName;
2433 break;
2434 }
2435 }
2436 else
2437 {
2438 v69 = pMapStats->pInfos[21].pName;
2439 }
2440 v200 = v69;
2441 v173 = v200;
2442 v157 = pGlobalTXT_LocalizationStrings[35];
2443 goto _sprintex_2args_draw_status_and_continue;
2444 }
2445 v68 = 210;
2446 break;
2330 } 2447 }
2331 } 2448 }
2332 else 2449 else
2333 { 2450 {
2334 v68 = 206; 2451 v68 = 206;
2336 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, v68) ) 2453 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, v68) )
2337 { 2454 {
2338 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); 2455 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
2339 continue; 2456 continue;
2340 } 2457 }
2341 LABEL_506: 2458 //LABEL_506:
2342 if ( uMessageParam ) 2459 if ( uMessageParam )
2343 { 2460 {
2344 switch ( uMessageParam ) 2461 switch ( uMessageParam )
2345 { 2462 {
2346 case 1: 2463 case 1:
2395 { 2512 {
2396 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubIndices / 2); 2513 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubIndices / 2);
2397 v70 = atoi(v216.pProperties[0]); 2514 v70 = atoi(v216.pProperties[0]);
2398 if ( v70 <= 0 || v70 >= 77 ) 2515 if ( v70 <= 0 || v70 >= 77 )
2399 { 2516 {
2400 LABEL_90: 2517 //LABEL_90:
2401 v1 = ""; 2518 v1 = "";
2402 LABEL_91: 2519 //LABEL_91:
2403 v0 = 1; 2520 v0 = 1;
2404 continue; 2521 continue;
2405 } 2522 }
2406 v71 = v70; 2523 v71 = v70;
2407 strcpy(Str2, pMapStats->pInfos[v70].pFilename); 2524 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
2433 v73 = Str2; 2550 v73 = Str2;
2434 } 2551 }
2435 else 2552 else
2436 { 2553 {
2437 if ( v216.field_0 != 3 ) 2554 if ( v216.field_0 != 3 )
2438 goto LABEL_90; 2555 //goto LABEL_90;
2556 {
2557 v1 = "";
2558 v0 = 1;
2559 continue;
2560 }
2439 v74 = atoi(v216.pProperties[0]); 2561 v74 = atoi(v216.pProperties[0]);
2440 thisi = atoi(v216.pProperties[1]); 2562 thisi = atoi(v216.pProperties[1]);
2441 v75 = atoi(v216.pProperties[2]); 2563 v75 = atoi(v216.pProperties[2]);
2442 v76 = v75; 2564 v76 = v75;
2443 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 2565 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
2444 { 2566 {
2445 if ( pIndoor->GetSector(v74, thisi, v75) ) 2567 if ( pIndoor->GetSector(v74, thisi, v75) )
2446 { 2568 {
2447 v77 = thisi; 2569 v77 = thisi;
2448 LABEL_544: 2570 //LABEL_544:
2449 pParty->vPosition.x = v74; 2571 pParty->vPosition.x = v74;
2450 pParty->vPosition.y = v77; 2572 pParty->vPosition.y = v77;
2451 pParty->vPosition.z = v76; 2573 pParty->vPosition.z = v76;
2452 pParty->uFallStartY = v76; 2574 pParty->uFallStartY = v76;
2453 goto LABEL_90; 2575 //goto LABEL_90;
2576 v1 = "";
2577 v0 = 1;
2578 continue;
2454 } 2579 }
2455 } 2580 }
2456 else 2581 else
2457 { 2582 {
2458 if ( v74 > -32768 ) 2583 if ( v74 > -32768 )
2461 { 2586 {
2462 v77 = thisi; 2587 v77 = thisi;
2463 if ( thisi > -32768 ) 2588 if ( thisi > -32768 )
2464 { 2589 {
2465 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) 2590 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 )
2466 goto LABEL_544; 2591 //goto LABEL_544;
2592 {
2593 pParty->vPosition.x = v74;
2594 pParty->vPosition.y = v77;
2595 pParty->vPosition.z = v76;
2596 pParty->uFallStartY = v76;
2597 //goto LABEL_90;
2598 v1 = "";
2599 v0 = 1;
2600 continue;
2601 }
2467 } 2602 }
2468 } 2603 }
2469 } 2604 }
2470 } 2605 }
2471 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2606 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2478 continue; 2613 continue;
2479 case 0x19: 2614 case 0x19:
2480 if ( bUnderwater == 1 ) 2615 if ( bUnderwater == 1 )
2481 goto LABEL_682; 2616 goto LABEL_682;
2482 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) 2617 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
2483 goto LABEL_90; 2618 //goto LABEL_90;
2619 {
2620 v1 = "";
2621 v0 = 1;
2622 continue;
2623 }
2484 v79 = pPlayer2->uQuickSpell; 2624 v79 = pPlayer2->uQuickSpell;
2485 v175 = uActiveCharacter; 2625 v175 = uActiveCharacter;
2486 v159 = 0; 2626 v159 = 0;
2487 v147 = 0; 2627 v147 = 0;
2488 v80 = uActiveCharacter - 1; 2628 v80 = uActiveCharacter - 1;
2489 goto LABEL_679; 2629 //goto LABEL_679;
2630 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
2631 continue;
2490 case 0x46: 2632 case 0x46:
2491 case UIMSG_Quit|0x8: 2633 case UIMSG_Quit|0x8:
2492 if ( pRenderer->pRenderD3D ) 2634 if ( pRenderer->pRenderD3D )
2493 { 2635 {
2494 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); 2636 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
2519 if ( uMessage == 140 ) 2661 if ( uMessage == 140 )
2520 *((char *)v51 + 9) &= 0xFEu; 2662 *((char *)v51 + 9) &= 0xFEu;
2521 else 2663 else
2522 *((char *)v51 + 9) &= 0xFDu; 2664 *((char *)v51 + 9) &= 0xFDu;
2523 } 2665 }
2524 goto LABEL_416; 2666 //goto LABEL_416;
2667 *((short *)v51 + 2) = uMessageParam;
2668 *((int *)v51 + 3) = v44;
2669 pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300);
2670 pWindow3 = pGUIWindow_Settings;
2671 pWindow3->Release();
2672 pGUIWindow_Settings = 0;
2673 pMouse->SetCursorBitmap("MICON1");
2674 GameUI_StatusBar_TimedStringTimeLeft = 0;
2675 unk_50C9A0 = 0;
2676 back_to_game();
2677 continue;
2525 case 0x1C: 2678 case 0x1C:
2526 if ( !uActiveCharacter || pCurrentScreen ) 2679 if ( !uActiveCharacter || pCurrentScreen )
2527 //goto LABEL_90; 2680 //goto LABEL_90;
2528 { 2681 {
2529 v1 = ""; 2682 v1 = "";
2541 v1 = ""; 2694 v1 = "";
2542 v0 = 1; 2695 v0 = 1;
2543 continue; 2696 continue;
2544 } 2697 }
2545 if ( pParty->bTurnBasedModeOn != v0 ) 2698 if ( pParty->bTurnBasedModeOn != v0 )
2546 goto LABEL_569; 2699 //goto LABEL_569;
2547 if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 ) 2700 {
2548 //goto LABEL_90;
2549 {
2550 v1 = "";
2551 v0 = 1;
2552 continue;
2553 }
2554 if ( !(pTurnEngine->field_18 & 2) )
2555 {
2556 LABEL_569:
2557 if ( pActors[uMessageParam].uAIState == 5 ) 2701 if ( pActors[uMessageParam].uAIState == 5 )
2558 stru_50C198.LootActor(&pActors[uMessageParam]); 2702 stru_50C198.LootActor(&pActors[uMessageParam]);
2559 else 2703 else
2560 Actor::StealFrom(uMessageParam); 2704 Actor::StealFrom(uMessageParam);
2705 continue;
2706 }
2707 if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 )
2708 //goto LABEL_90;
2709 {
2710 v1 = "";
2711 v0 = 1;
2712 continue;
2713 }
2714 if ( !(pTurnEngine->field_18 & 2) )
2715 {
2716 //LABEL_569:
2717 if ( pActors[uMessageParam].uAIState == 5 )
2718 stru_50C198.LootActor(&pActors[uMessageParam]);
2719 else
2720 Actor::StealFrom(uMessageParam);
2561 } 2721 }
2562 continue; 2722 continue;
2563 case 0x17: 2723 case 0x17:
2564 if ( !uActiveCharacter ) 2724 if ( !uActiveCharacter )
2565 //goto LABEL_90; 2725 //goto LABEL_90;
2567 v1 = ""; 2727 v1 = "";
2568 v0 = 1; 2728 v0 = 1;
2569 continue; 2729 continue;
2570 } 2730 }
2571 if ( pParty->bTurnBasedModeOn != v0 ) 2731 if ( pParty->bTurnBasedModeOn != v0 )
2572 goto LABEL_577; 2732 //goto LABEL_577;
2733 {
2734 _42ECB5_PlayerAttacksActor();
2735 continue;
2736 }
2573 if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 ) 2737 if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 )
2574 //goto LABEL_90; 2738 //goto LABEL_90;
2575 { 2739 {
2576 v1 = ""; 2740 v1 = "";
2577 v0 = 1; 2741 v0 = 1;
2578 continue; 2742 continue;
2579 } 2743 }
2580 if ( !(pTurnEngine->field_18 & 2) ) 2744 if ( !(pTurnEngine->field_18 & 2) )
2581 LABEL_577: 2745 //LABEL_577:
2582 _42ECB5_PlayerAttacksActor(); 2746 _42ECB5_PlayerAttacksActor();
2583 continue; 2747 continue;
2584 case UIMSG_A7: 2748 case UIMSG_A7:
2585 v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest" 2749 v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest"
2586 pButton = pButton_RestUI_Exit; 2750 pButton = pButton_RestUI_Exit;
2587 pButton2 = pButton_RestUI_Exit; 2751 pButton2 = pButton_RestUI_Exit;
2588 pWindowType1 = (WindowType)96; 2752 pWindowType1 = (WindowType)96;
2589 goto LABEL_731; 2753 //goto LABEL_731;
2754 v8 = pButton->uY;
2755 v9 = pButton->uX;
2756 //goto LABEL_732;
2757 v137 = 0;
2758 v133 = 0;
2759 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
2760 continue;
2590 case UIMSG_ShowStatus_Player|0x1: 2761 case UIMSG_ShowStatus_Player|0x1:
2591 if ( dword_506F14 == 2 ) 2762 if ( dword_506F14 == 2 )
2592 goto LABEL_621; 2763 //goto LABEL_621;
2764 {
2765 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2766 goto LABEL_622;
2767 }
2593 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90, 2768 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90,
2594 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" 2769 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2595 dword_506F14 = v0; 2770 dword_506F14 = v0;
2596 _506F18_num_hours_to_sleep = 5; 2771 _506F18_num_hours_to_sleep = 5;
2597 continue; 2772 continue;
2598 case 0x60: 2773 case 0x60:
2599 if ( dword_506F14 == 2 ) 2774 if ( dword_506F14 == 2 )
2600 goto LABEL_621; 2775 //goto LABEL_621;
2776 {
2777 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2778 goto LABEL_622;
2779 }
2601 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, (enum WindowType)90, 2780 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, (enum WindowType)90,
2602 (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" 2781 (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2603 dword_506F14 = v0; 2782 dword_506F14 = v0;
2604 _506F18_num_hours_to_sleep = 60; 2783 _506F18_num_hours_to_sleep = 60;
2605 continue; 2784 continue;
2608 RestUI_Initialize(); 2787 RestUI_Initialize();
2609 v86 = 60 * (sub_494820(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; 2788 v86 = 60 * (sub_494820(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
2610 _506F18_num_hours_to_sleep = v86; 2789 _506F18_num_hours_to_sleep = v86;
2611 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) 2790 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 )
2612 _506F18_num_hours_to_sleep = v86 + 720; 2791 _506F18_num_hours_to_sleep = v86 + 720;
2613 goto LABEL_615; 2792 //goto LABEL_615;
2793 dword_506F14 = 2;
2794 pParty->RestAndHeal();
2795 pParty->field_764 = 0;
2796 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
2797 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
2798 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
2799 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
2800 continue;
2614 case 0x68: 2801 case 0x68:
2615 if ( pMessageQueue_50CBD0->uNumMessages ) 2802 if ( pMessageQueue_50CBD0->uNumMessages )
2616 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 2803 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2617 if ( pCurrentScreen ) 2804 if ( pCurrentScreen )
2618 continue; 2805 continue;
2619 if ( sub_42F4DA() ) 2806 if ( sub_42F4DA() )
2620 goto LABEL_594; 2807 //goto LABEL_594;
2808 {
2809 if ( pParty->bTurnBasedModeOn == v0 )
2810 {
2811 v87 = pGlobalTXT_LocalizationStrings[478];// "You can't rest in turn-based mode!"
2812 ShowStatusBarString(v87, 2u);
2813 continue;
2814 }
2815 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
2816 if ( pParty->uFlags & 0x88 )
2817 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2818 ShowStatusBarString(v88, 2u);
2819 v89 = uActiveCharacter;
2820 if ( !uActiveCharacter )
2821 {
2822 v1 = "";
2823 v0 = 1;
2824 continue;
2825 }
2826 v176 = 0;
2827 v160 = 13;
2828 goto LABEL_619;
2829 }
2621 if ( pParty->bTurnBasedModeOn == v0 ) 2830 if ( pParty->bTurnBasedModeOn == v0 )
2622 goto LABEL_595; 2831 //goto LABEL_595;
2832 {
2833 v87 = pGlobalTXT_LocalizationStrings[478];// "You can't rest in turn-based mode!"
2834 ShowStatusBarString(v87, 2u);
2835 continue;
2836 }
2623 if ( !(pParty->uFlags & 0x88) ) 2837 if ( !(pParty->uFlags & 0x88) )
2624 { 2838 {
2625 RestUI_Initialize(); 2839 RestUI_Initialize();
2626 continue; 2840 continue;
2627 } 2841 }
2628 LABEL_594: 2842 //LABEL_594:
2629 if ( pParty->bTurnBasedModeOn == v0 ) 2843 if ( pParty->bTurnBasedModeOn == v0 )
2630 { 2844 {
2631 LABEL_595: 2845 //LABEL_595:
2632 v87 = pGlobalTXT_LocalizationStrings[478];// "You can't rest in turn-based mode!" 2846 v87 = pGlobalTXT_LocalizationStrings[478];// "You can't rest in turn-based mode!"
2633 goto _draw_status_string_and_continue; 2847 //goto _draw_status_string_and_continue;
2848 ShowStatusBarString(v87, 2u);
2849 continue;
2634 } 2850 }
2635 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" 2851 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
2636 if ( pParty->uFlags & 0x88 ) 2852 if ( pParty->uFlags & 0x88 )
2637 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" 2853 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2638 ShowStatusBarString(v88, 2u); 2854 ShowStatusBarString(v88, 2u);
2647 v176 = 0; 2863 v176 = 0;
2648 v160 = 13; 2864 v160 = 13;
2649 goto LABEL_619; 2865 goto LABEL_619;
2650 case 0x61: 2866 case 0x61:
2651 if ( dword_506F14 ) 2867 if ( dword_506F14 )
2652 goto LABEL_621; 2868 //goto LABEL_621;
2869 {
2870 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2871 goto LABEL_622;
2872 }
2653 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) 2873 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
2654 { 2874 {
2655 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" 2875 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest"
2656 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) 2876 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() )
2657 { 2877 {
2711 goto _play_sound_and_continue; 2931 goto _play_sound_and_continue;
2712 } 2932 }
2713 } 2933 }
2714 Party::TakeFood(uRestUI_FoodRequiredToRest); 2934 Party::TakeFood(uRestUI_FoodRequiredToRest);
2715 _506F18_num_hours_to_sleep = 480; 2935 _506F18_num_hours_to_sleep = 480;
2716 LABEL_615: 2936 //LABEL_615:
2717 dword_506F14 = 2; 2937 dword_506F14 = 2;
2718 pParty->RestAndHeal(); 2938 pParty->RestAndHeal();
2719 pParty->field_764 = 0; 2939 pParty->field_764 = 0;
2720 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed; 2940 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
2721 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed; 2941 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
2724 } 2944 }
2725 continue; 2945 continue;
2726 case UIMSG_ShowStatus_Funds|0x8: 2946 case UIMSG_ShowStatus_Funds|0x8:
2727 if ( dword_506F14 == 2 ) 2947 if ( dword_506F14 == 2 )
2728 { 2948 {
2729 LABEL_621: 2949 //LABEL_621:
2730 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" 2950 v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!"
2731 goto LABEL_622; 2951 goto LABEL_622;
2732 } 2952 }
2733 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, (enum WindowType)90, 2953 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, (enum WindowType)90,
2734 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" 2954 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
2750 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" 2970 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
2751 else 2971 else
2752 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" 2972 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
2753 strcpy(pTmpBuf, v177); 2973 strcpy(pTmpBuf, v177);
2754 } 2974 }
2755 _set_status_string_pTmpBuf_and_continue: 2975 //_set_status_string_pTmpBuf_and_continue:
2756 sub_41C0B8_set_status_string(pTmpBuf); 2976 sub_41C0B8_set_status_string(pTmpBuf);
2757 continue; 2977 continue;
2758 case 0x4F: 2978 case 0x4F:
2759 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], 2979 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
2760 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) 2980 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
2772 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; 2992 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
2773 v161 = pGlobalTXT_LocalizationStrings[486]; 2993 v161 = pGlobalTXT_LocalizationStrings[486];
2774 } 2994 }
2775 sprintf(pTmpBuf, v161, v178); 2995 sprintf(pTmpBuf, v161, v178);
2776 sub_41C0B8_set_status_string(pTmpBuf); 2996 sub_41C0B8_set_status_string(pTmpBuf);
2777 goto LABEL_91; 2997 //goto LABEL_91;
2998 v0 = 1;
2999 continue;
2778 case 0x58: 3000 case 0x58:
2779 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0); 3001 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0);
2780 if ( !uActiveCharacter ) 3002 if ( !uActiveCharacter )
2781 continue; 3003 continue;
2782 pPlayer10 = pPlayers[uActiveCharacter]; 3004 pPlayer10 = pPlayers[uActiveCharacter];
2822 thisl += 2; 3044 thisl += 2;
2823 ++v101; 3045 ++v101;
2824 } 3046 }
2825 while ( v101 < 9 ); 3047 while ( v101 < 9 );
2826 if ( !pNPCData4 ) 3048 if ( !pNPCData4 )
2827 goto LABEL_662; 3049 {
3050 v165 = 0;
3051 v151 = 0;
3052 v144 = 0;
3053 v139 = 0;
3054 v135 = -1;
3055 v132 = 0;
3056 v130 = 0;
3057 v127 = rand() % 2 + 204;
3058 goto _play_sound_and_continue;
3059 }
2828 if ( GetAsyncKeyState(16) ) 3060 if ( GetAsyncKeyState(16) )
2829 { 3061 {
2830 --uAction; 3062 --uAction;
2831 if ( uAction < 0 ) 3063 if ( uAction < 0 )
2832 uAction = (int)((char *)pNPCData4 - 1); 3064 uAction = (int)((char *)pNPCData4 - 1);
2837 if ( uAction >= (signed int)pNPCData4 ) 3069 if ( uAction >= (signed int)pNPCData4 )
2838 uAction = 0; 3070 uAction = 0;
2839 } 3071 }
2840 sub_41140B(); 3072 sub_41140B();
2841 pPlayers[uActiveCharacter]->pNumSpellBookPage = LOBYTE(v217[uAction]); 3073 pPlayers[uActiveCharacter]->pNumSpellBookPage = LOBYTE(v217[uAction]);
2842 goto LABEL_661; 3074 pGUIWindow_CurrentMenu->OpenSpellBook();
3075 v165 = 0;
3076 v151 = 0;
3077 v144 = 0;
3078 v139 = 0;
3079 v135 = -1;
3080 v132 = 0;
3081 v130 = 0;
3082 v127 = rand() % 2 + 204;
3083 goto _play_sound_and_continue;
2843 case UIMSG_SaveGame|0x4: 3084 case UIMSG_SaveGame|0x4:
2844 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage ) 3085 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage )
2845 continue; 3086 continue;
2846 sub_41140B(); 3087 sub_41140B();
2847 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam; 3088 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam;
2848 LABEL_661: 3089 pGUIWindow_CurrentMenu->OpenSpellBook();
2849 pGUIWindow_CurrentMenu->_411621();
2850 LABEL_662:
2851 v165 = 0; 3090 v165 = 0;
2852 v151 = 0; 3091 v151 = 0;
2853 v144 = 0; 3092 v144 = 0;
2854 v139 = 0; 3093 v139 = 0;
2855 v135 = -1; 3094 v135 = -1;
2894 if ( pTurnEngine->field_4 == 3 ) 3133 if ( pTurnEngine->field_4 == 3 )
2895 continue; 3134 continue;
2896 v175 = 0; 3135 v175 = 0;
2897 v159 = 0; 3136 v159 = 0;
2898 v147 = 0; 3137 v147 = 0;
2899 goto LABEL_678; 3138 //goto LABEL_678;
3139 v80 = v199;
3140 v79 = uMessageParam;
3141 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
3142 continue;
2900 case 0x92: 3143 case 0x92:
2901 if ( pTurnEngine->field_4 != 3 ) 3144 if ( pTurnEngine->field_4 != 3 )
2902 { 3145 {
2903 v175 = 0; 3146 v175 = 0;
2904 v159 = v0; 3147 v159 = v0;
2905 v147 = 133; 3148 v147 = 133;
2906 LABEL_678: 3149 //LABEL_678:
2907 v80 = v199; 3150 v80 = v199;
2908 v79 = uMessageParam; 3151 v79 = uMessageParam;
2909 LABEL_679: 3152 //LABEL_679:
2910 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175); 3153 _42777D_CastSpell_UseWand_ShootArrow(v79, v80, v147, v159, v175);
2911 } 3154 }
2912 continue; 3155 continue;
2913 case 0x69: 3156 case 0x69:
2914 if ( pTurnEngine->field_4 == 3 ) 3157 if ( pTurnEngine->field_4 == 3 )
2936 if ( pMessageQueue_50CBD0->uNumMessages ) 3179 if ( pMessageQueue_50CBD0->uNumMessages )
2937 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3180 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2938 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) 3181 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
2939 { 3182 {
2940 if ( !pCurrentScreen ) 3183 if ( !pCurrentScreen )
2941 goto LABEL_693; 3184 //goto LABEL_693;
3185 {
3186 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
3187 pCurrentScreen = 8;
3188 pEventTimer->Pause();
3189 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
3190 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
3191 viewparams->field_48 = v0;
3192 continue;
3193 }
2942 if ( pCurrentScreen != 5 3194 if ( pCurrentScreen != 5
2943 && pCurrentScreen != 7 3195 && pCurrentScreen != 7
2944 && (pCurrentScreen <= 99 3196 && (pCurrentScreen <= 99
2945 || pCurrentScreen > 103) ) 3197 || pCurrentScreen > 103) )
2946 { 3198 {
2947 pGUIWindow_CurrentMenu->Release(); 3199 pGUIWindow_CurrentMenu->Release();
2948 LABEL_693: 3200 //LABEL_693:
2949 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0); 3201 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_CastSpell, 0);
2950 pCurrentScreen = 8; 3202 pCurrentScreen = 8;
2951 pEventTimer->Pause(); 3203 pEventTimer->Pause();
2952 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0); 3204 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
2953 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); 3205 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
2955 continue; 3207 continue;
2956 } 3208 }
2957 } 3209 }
2958 } 3210 }
2959 continue; 3211 continue;
2960 case 0x6A: 3212 case UIMSG_QuickReference:
2961 if ( pMessageQueue_50CBD0->uNumMessages ) 3213 if ( pMessageQueue_50CBD0->uNumMessages )
2962 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3214 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2963 if ( pCurrentScreen ) 3215 if ( pCurrentScreen )
2964 pGUIWindow_CurrentMenu->Release(); 3216 pGUIWindow_CurrentMenu->Release();
2965 ++pIcons_LOD->uTexturePacksCount; 3217 ++pIcons_LOD->uTexturePacksCount;
2966 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 3218 if ( !pIcons_LOD->uNumPrevLoadedFiles )
2967 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 3219 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2968 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_QuickReference, 0); 3220 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_5A, (int)pBtn_QuickReference, 0);
2969 viewparams->bRedrawGameUI = v0; 3221 viewparams->bRedrawGameUI = v0;
2970 pEventTimer->Pause(); 3222 pEventTimer->Pause();
2971 pAudioPlayer->StopChannels(-1, -1); 3223 pAudioPlayer->StopChannels(-1, -1);
2972 pCurrentScreen = 104; 3224 pCurrentScreen = 104;
2973 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0); 3225 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0);
2988 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); 3240 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
2989 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 3241 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
2990 free((void *)uNumSeconds); 3242 free((void *)uNumSeconds);
2991 stru_506E40._40E55E("gamma.pcx", 0); 3243 stru_506E40._40E55E("gamma.pcx", 0);
2992 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 3244 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0);
2993 LABEL_453: 3245 //LABEL_453:
2994 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3246 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
2995 continue; 3247 continue;
2996 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 3248 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2997 goto LABEL_770; 3249 //goto LABEL_770;
3250 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3251 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3252 ++pMessageQueue_50CBD0->uNumMessages;
3253 continue;
2998 case UIMSG_C0: 3254 case UIMSG_C0:
2999 dword_50651C = v0; 3255 dword_50651C = v0;
3000 if ( pMouse->GetCursorPos(&v211)->y > 178 ) 3256 if ( pMouse->GetCursorPos(&v211)->y > 178 )
3001 dword_50651C = -1; 3257 dword_50651C = -1;
3002 continue; 3258 continue;
3003 case UIMSG_A9: 3259 case UIMSG_A9:
3004 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Up, 0); 3260 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Up, 0);
3005 LABEL_707: 3261 //LABEL_707:
3006 dword_506548 = v0; 3262 dword_506548 = v0;
3007 continue; 3263 continue;
3008 case UIMSG_AA: 3264 case UIMSG_AA:
3009 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Down, 0); 3265 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)pBtn_Down, 0);
3010 LABEL_709: 3266 //LABEL_709:
3011 dword_506544 = v0; 3267 dword_506544 = v0;
3012 continue; 3268 continue;
3013 case 0x55: 3269 case 0x55:
3014 bRingsShownInCharScreen ^= v0; 3270 bRingsShownInCharScreen ^= v0;
3015 GUIButton::_41D0D8(pCharacterScreen_DetalizBtn); 3271 GUIButton::_41D0D8(pCharacterScreen_DetalizBtn);
3039 case UIMSG_Escape|0x2: 3295 case UIMSG_Escape|0x2:
3040 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 3296 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
3041 sub_4196A0(); 3297 sub_4196A0();
3042 sub_419379(); 3298 sub_419379();
3043 pButton = pCharacterScreen_StatsBtn; 3299 pButton = pCharacterScreen_StatsBtn;
3044 goto LABEL_716; 3300 //goto LABEL_716;
3301 v163 = 0;
3302 pButton2 = pButton;
3303 pWindowType1 = (WindowType)91;
3304 v8 = pButton->uY;
3305 v9 = pButton->uX;
3306 //goto LABEL_732;
3307 v137 = 0;
3308 v133 = 0;
3309 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3310 continue;
3045 case UIMSG_ChangeMusicVolume|0x2: 3311 case UIMSG_ChangeMusicVolume|0x2:
3046 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; 3312 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
3047 sub_4196A0(); 3313 sub_4196A0();
3048 sub_419379(); 3314 sub_419379();
3049 sub_419401(); 3315 sub_419401();
3050 pButton = pCharacterScreen_SkillsBtn; 3316 pButton = pCharacterScreen_SkillsBtn;
3051 goto LABEL_716; 3317 //goto LABEL_716;
3318 v163 = 0;
3319 pButton2 = pButton;
3320 pWindowType1 = (WindowType)91;
3321 v8 = pButton->uY;
3322 v9 = pButton->uX;
3323 //goto LABEL_732;
3324 v137 = 0;
3325 v133 = 0;
3326 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3327 continue;
3052 case UIMSG_SkillUp: 3328 case UIMSG_SkillUp:
3053 pPlayer4 = pPlayers[uActiveCharacter]; 3329 pPlayer4 = pPlayers[uActiveCharacter];
3054 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; 3330 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
3055 LOWORD(v2) = *(short *)v105; 3331 LOWORD(v2) = *(short *)v105;
3056 uNumSeconds = v2; 3332 uNumSeconds = v2;
3075 v127 = 20001; 3351 v127 = 20001;
3076 goto _play_sound_and_continue; 3352 goto _play_sound_and_continue;
3077 } 3353 }
3078 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" 3354 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
3079 } 3355 }
3080 _draw_status_string_and_continue: 3356 //_draw_status_string_and_continue:
3081 ShowStatusBarString(v87, 2u); 3357 ShowStatusBarString(v87, 2u);
3082 continue; 3358 continue;
3083 case UIMSG_ChangeMusicVolume|0x4: 3359 case UIMSG_ChangeMusicVolume|0x4:
3084 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; 3360 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
3085 sub_419379(); 3361 sub_419379();
3086 sub_4196A0(); 3362 sub_4196A0();
3087 pButton = pCharacterScreen_InventoryBtn; 3363 pButton = pCharacterScreen_InventoryBtn;
3088 LABEL_716: 3364 //LABEL_716:
3089 v163 = 0; 3365 v163 = 0;
3090 pButton2 = pButton; 3366 pButton2 = pButton;
3091 pWindowType1 = (WindowType)91; 3367 pWindowType1 = (WindowType)91;
3092 goto LABEL_731; 3368 //goto LABEL_731;
3369 v8 = pButton->uY;
3370 v9 = pButton->uX;
3371 //goto LABEL_732;
3372 v137 = 0;
3373 v133 = 0;
3374 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3375 continue;
3093 case UIMSG_A8: 3376 case UIMSG_A8:
3094 pButton = pCharacterScreen_ExitBtn; 3377 pButton = pCharacterScreen_ExitBtn;
3095 v163 = 0; 3378 v163 = 0;
3096 pButton2 = pCharacterScreen_ExitBtn; 3379 pButton2 = pCharacterScreen_ExitBtn;
3097 pWindowType1 = (WindowType)97; 3380 pWindowType1 = (WindowType)97;
3098 goto LABEL_731; 3381 //goto LABEL_731;
3382 v8 = pButton->uY;
3383 v9 = pButton->uX;
3384 //goto LABEL_732;
3385 v137 = 0;
3386 v133 = 0;
3387 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3388 continue;
3099 case UIMSG_Escape|0x4: 3389 case UIMSG_Escape|0x4:
3100 sub_419379(); 3390 sub_419379();
3101 sub_4196A0(); 3391 sub_4196A0();
3102 sub_419220(); 3392 sub_419220();
3103 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; 3393 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
3109 switch ( uMessageParam ) 3399 switch ( uMessageParam )
3110 { 3400 {
3111 default: 3401 default:
3112 continue; 3402 continue;
3113 case 11: 3403 case 11:
3114 goto LABEL_707; 3404 //goto LABEL_707;
3405 dword_506548 = v0;
3406 continue;
3115 case 10: 3407 case 10:
3116 goto LABEL_709; 3408 //goto LABEL_709;
3409 dword_506544 = v0;
3410 continue;
3117 case 0: 3411 case 0:
3118 pButton = pBtn_Book_1; 3412 pButton = pBtn_Book_1;
3119 dword_506544 = v0; 3413 dword_506544 = v0;
3120 break; 3414 break;
3121 case 1: 3415 case 1:
3156 break; 3450 break;
3157 } 3451 }
3158 v163 = v0; 3452 v163 = v0;
3159 pButton2 = pButton; 3453 pButton2 = pButton;
3160 pWindowType1 = (WindowType)92; 3454 pWindowType1 = (WindowType)92;
3161 LABEL_731: 3455 //LABEL_731:
3162 v8 = pButton->uY; 3456 v8 = pButton->uY;
3163 v9 = pButton->uX; 3457 v9 = pButton->uX;
3164 goto LABEL_732; 3458 //goto LABEL_732;
3459 v137 = 0;
3460 v133 = 0;
3461 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3462 continue;
3165 case UIMSG_SelectCharacter: 3463 case UIMSG_SelectCharacter:
3166 if ( pMessageQueue_50CBD0->uNumMessages ) 3464 if ( pMessageQueue_50CBD0->uNumMessages )
3167 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3465 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3168 GameUI_OnPlayerPortraitLeftClick(uMessageParam); 3466 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
3169 continue; 3467 continue;
3170 case UIMSG_ShowStatus_Funds: 3468 case UIMSG_ShowStatus_Funds:
3171 v174 = (char *)pParty->uNumGoldInBank; 3469 v174 = (char *)pParty->uNumGoldInBank;
3172 v158 = pParty->uNumGold + pParty->uNumGoldInBank; 3470 v158 = pParty->uNumGold + pParty->uNumGoldInBank;
3173 v146 = pGlobalTXT_LocalizationStrings[489];// "You have %d total gold, %d in the Bank"" 3471 v146 = pGlobalTXT_LocalizationStrings[489];// "You have %d total gold, %d in the Bank""
3174 goto _sprintex_draw_status_and_continue; 3472 //goto _sprintex_draw_status_and_continue;
3473 sprintf(pTmpBuf, v146, v158, v174);
3474 sub_41C0B8_set_status_string(pTmpBuf);
3475 continue;
3175 case UIMSG_ShowStatus_DateTime: 3476 case UIMSG_ShowStatus_DateTime:
3176 pNPCData4 = (NPCData *)pParty->uCurrentHour; 3477 pNPCData4 = (NPCData *)pParty->uCurrentHour;
3177 if ( (signed int)pParty->uCurrentHour <= 12 ) 3478 if ( (signed int)pParty->uCurrentHour <= 12 )
3178 { 3479 {
3179 if ( !pNPCData4 ) 3480 if ( !pNPCData4 )
3185 } 3486 }
3186 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = v0, pParty->uCurrentHour >= 0x18) ) 3487 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = v0, pParty->uCurrentHour >= 0x18) )
3187 uNumSeconds = 0; 3488 uNumSeconds = 0;
3188 sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], 3489 sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
3189 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); 3490 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
3190 goto _set_status_string_pTmpBuf_and_continue; 3491 sub_41C0B8_set_status_string(pTmpBuf);
3492 continue;
3191 case UIMSG_ShowStatus_Food: 3493 case UIMSG_ShowStatus_Food:
3192 v173 = (char *)pParty->uNumFoodRations; 3494 v173 = (char *)pParty->uNumFoodRations;
3193 v157 = pGlobalTXT_LocalizationStrings[501];// You have %lu food" 3495 v157 = pGlobalTXT_LocalizationStrings[501];// You have %lu food"
3194 goto _sprintex_2args_draw_status_and_continue; 3496 goto _sprintex_2args_draw_status_and_continue;
3195 case UIMSG_ShowStatus_Player: 3497 case UIMSG_ShowStatus_Player:
3209 v111 = v110->GetMaxMana(); 3511 v111 = v110->GetMaxMana();
3210 v112 = v110->sMana; 3512 v112 = v110->sMana;
3211 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" 3513 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points"
3212 v114 = v110->GetMaxHealth(); 3514 v114 = v110->GetMaxHealth();
3213 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); 3515 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
3214 goto _set_status_string_pTmpBuf_and_continue; 3516 sub_41C0B8_set_status_string(pTmpBuf);
3517 continue;
3215 case 0xC: 3518 case 0xC:
3216 if ( pCurrentScreen == 15 ) 3519 if ( pCurrentScreen == 15 )
3217 goto LABEL_762; 3520 {
3521 sub_421EA6_OnInventoryLeftClick();
3522 continue;
3523 }
3218 sub_420E01(); 3524 sub_420E01();
3219 continue; 3525 continue;
3220 case UIMSG_ChangeMusicVolume|0x8: 3526 case UIMSG_ChangeMusicVolume|0x8:
3221 LABEL_762:
3222 sub_421EA6_OnInventoryLeftClick(); 3527 sub_421EA6_OnInventoryLeftClick();
3223 continue; 3528 continue;
3224 case 0xA: 3529 case 0xA:
3225 if ( !pRenderer->pRenderD3D ) 3530 if ( !pRenderer->pRenderD3D )
3226 goto LABEL_772; 3531 //goto LABEL_772;
3532 {
3533 if ( pMessageQueue_50CBD0->uNumMessages )
3534 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3535 OnGameViewportClick();
3536 continue;
3537 }
3227 v115 = pMessageQueue_50CBD0->uNumMessages; 3538 v115 = pMessageQueue_50CBD0->uNumMessages;
3228 if ( !pMessageQueue_50CBD0->uNumMessages ) 3539 if ( !pMessageQueue_50CBD0->uNumMessages )
3229 goto LABEL_768; 3540 //goto LABEL_768;
3541 {
3542 if ( (signed int)v115 < 40 )
3543 //goto LABEL_769;
3544 {
3545 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3546 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3547 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3548 ++pMessageQueue_50CBD0->uNumMessages;
3549 continue;
3550 }
3551 continue;
3552 }
3230 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) 3553 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
3231 { 3554 {
3232 v115 = v0; 3555 v115 = v0;
3233 pMessageQueue_50CBD0->uNumMessages = v0; 3556 pMessageQueue_50CBD0->uNumMessages = v0;
3234 LABEL_769: 3557 //LABEL_769:
3235 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14; 3558 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3236 LABEL_770: 3559 //LABEL_770:
3237 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3560 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3238 goto LABEL_771; 3561 //goto LABEL_771;
3562 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3563 ++pMessageQueue_50CBD0->uNumMessages;
3564 continue;
3239 } 3565 }
3240 v115 = 0; 3566 v115 = 0;
3241 pMessageQueue_50CBD0->uNumMessages = 0; 3567 pMessageQueue_50CBD0->uNumMessages = 0;
3242 LABEL_768: 3568 //LABEL_768:
3243 if ( (signed int)v115 < 40 ) 3569 if ( (signed int)v115 < 40 )
3244 goto LABEL_769; 3570 //goto LABEL_769;
3571 {
3572 pMessageQueue_50CBD0->pMessages[v115].eType = (UIMessageType)14;
3573 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3574 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3575 ++pMessageQueue_50CBD0->uNumMessages;
3576 continue;
3577 }
3245 continue; 3578 continue;
3246 case 0xE: 3579 case 0xE:
3247 LABEL_772: 3580 //LABEL_772:
3248 if ( pMessageQueue_50CBD0->uNumMessages ) 3581 if ( pMessageQueue_50CBD0->uNumMessages )
3249 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3582 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3250 OnGameViewportClick(); 3583 OnGameViewportClick();
3251 continue; 3584 continue;
3252 case 0xF: 3585 case 0xF:
3261 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; 3594 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
3262 } 3595 }
3263 v163 = 0; 3596 v163 = 0;
3264 pButton2 = (GUIButton *)(unsigned __int16)v116; 3597 pButton2 = (GUIButton *)(unsigned __int16)v116;
3265 pWindowType1 = (WindowType)15; 3598 pWindowType1 = (WindowType)15;
3266 goto LABEL_779; 3599 //goto LABEL_779;
3600 v8 = 0;
3601 v9 = 0;
3602 v137 = 0;
3603 v133 = 0;
3604 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3605 continue;
3267 case 0x54: 3606 case 0x54:
3268 v163 = 0; 3607 v163 = 0;
3269 pButton2 = (GUIButton *)uMessageParam; 3608 pButton2 = (GUIButton *)uMessageParam;
3270 pWindowType1 = (WindowType)22; 3609 pWindowType1 = (WindowType)22;
3271 LABEL_779: 3610 //LABEL_779:
3272 v8 = 0; 3611 v8 = 0;
3273 v9 = 0; 3612 v9 = 0;
3274 LABEL_732: 3613 //LABEL_732:
3275 v137 = 0; 3614 v137 = 0;
3276 v133 = 0; 3615 v133 = 0;
3277 LABEL_733: 3616 //LABEL_733:
3278 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); 3617 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163);
3279 continue; 3618 continue;
3280 case 0x194: 3619 case 0x194:
3281 if ( pMessageQueue_50CBD0->uNumMessages ) 3620 if ( pMessageQueue_50CBD0->uNumMessages )
3282 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3621 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
6112 6451
6113 //----- (0043BCA7) -------------------------------------------------------- 6452 //----- (0043BCA7) --------------------------------------------------------
6114 int __cdecl CharacterUI_LoadPaperdollTextures() 6453 int __cdecl CharacterUI_LoadPaperdollTextures()
6115 { 6454 {
6116 int v0; // edi@7 6455 int v0; // edi@7
6117 enum CHARACTER_RACE v1; // ebx@7 6456 enum CHARACTER_RACE pRace; // ebx@7
6118 signed int v2; // eax@7 6457 signed int pSex; // eax@7
6119 int v3; // ebx@10 6458 int v3; // ebx@10
6120 Player *v4; // edi@12 6459 Player *pPlayer; // edi@12
6121 unsigned __int8 v5; // cl@12 6460 unsigned __int8 v5; // cl@12
6122 int v6; // edi@16 6461 int v6; // edi@16
6123 unsigned int v7; // eax@16 6462 unsigned int v7; // eax@16
6124 Player *v8; // ebx@16 6463 Player *pPlayer2; // ebx@16
6125 char *v9; // ebx@16 6464 char *v9; // ebx@16
6126 char v10; // al@16 6465 char v10; // al@16
6127 signed int v11; // edi@21 6466 signed int v11; // edi@21
6128 Player *v12; // ebx@23 6467 Player *pPlayer3; // ebx@23
6129 Player *v13; // edi@29 6468 Player *pPlayer4; // edi@29
6130 int v14; // ebp@29 6469 int v14; // ebp@29
6131 stru331 *v15; // edi@65 6470 stru331 *v15; // edi@65
6132 signed int v16; // ebx@66 6471 signed int v16; // ebx@66
6133 unsigned int v17; // eax@67 6472 unsigned int v17; // eax@67
6134 unsigned int *v18; // ecx@67 6473 unsigned int *v18; // ecx@67
6170 { 6509 {
6171 v42 = v30 + 1; 6510 v42 = v30 + 1;
6172 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) 6511 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) )
6173 { 6512 {
6174 v0 = v30; 6513 v0 = v30;
6175 v1 = pPlayers[v30 + 1]->GetRace(); 6514 pRace = pPlayers[v30 + 1]->GetRace();
6176 v2 = pPlayers[v30 + 1]->GetSexByVoice(); 6515 pSex = pPlayers[v30 + 1]->GetSexByVoice();
6177 if ( v1 && v1 != 1 && v1 != 2 ) 6516 if ( pRace && pRace != 1 && pRace != 2 )//race == 3
6178 v3 = (v2 != 0) + 3; 6517 v3 = (pSex != 0) + 3;
6179 else 6518 else
6180 v3 = (v2 != 0) + 1; 6519 v3 = (pSex != 0) + 1;
6181 wsprintfA(pContainer, "pc23v%dBod", v3); 6520 wsprintfA(pContainer, "pc23v%dBod", v3);
6182 papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6521 papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture
6183 wsprintfA(pContainer, "pc23v%dlad", v3); 6522 wsprintfA(pContainer, "pc23v%dlad", v3);
6184 papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6523 papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand
6185 wsprintfA(pContainer, "pc23v%dlau", v3); 6524 wsprintfA(pContainer, "pc23v%dlau", v3);
6186 papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6525 papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2
6187 wsprintfA(pContainer, "pc23v%drh", v3); 6526 wsprintfA(pContainer, "pc23v%drh", v3);
6188 papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6527 papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand
6189 wsprintfA(pContainer, "pc23v%dlh", v3); 6528 wsprintfA(pContainer, "pc23v%dlh", v3);
6190 papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6529 papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist
6191 wsprintfA(pContainer, "pc23v%dlhu", v3); 6530 wsprintfA(pContainer, "pc23v%dlhu", v3);
6192 papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6531 papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2
6193 v4 = pPlayers[v0 + 1]; 6532 pPlayer = pPlayers[v0 + 1];
6194 v5 = v4->uFace; 6533 v5 = pPlayer->uFace;
6195 if ( v5 == 12 || v5 == 13 ) 6534 if ( v5 == 12 || v5 == 13 )
6196 papredoll_dbrds[(char)v5] = 0; 6535 papredoll_dbrds[(char)v5] = 0;
6197 papredoll_flying_feet[v4->uFace] = 0; 6536 papredoll_flying_feet[pPlayer->uFace] = 0;
6198 IsPlayerWearingWatersuit[v30 + 1] = 1; 6537 IsPlayerWearingWatersuit[v30 + 1] = 1;
6199 } 6538 }
6200 else 6539 else
6201 { 6540 {
6202 v6 = v30; 6541 v6 = v30;
6203 papredoll_dbods[v30] = pIcons_LOD->LoadTexture( 6542 papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6204 dbod_texnames_by_face[pPlayers[v30 + 1]->uFace], 6543 papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6205 TEXTURE_16BIT_PALETTE); 6544 papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6206 papredoll_dlads[v30] = pIcons_LOD->LoadTexture( 6545 papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6207 dlad_texnames_by_face[pPlayers[v30 + 1]->uFace], 6546 papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6208 TEXTURE_16BIT_PALETTE); 6547 v7 = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE);
6209 papredoll_dlaus[v30] = pIcons_LOD->LoadTexture( 6548 pPlayer2 = pPlayers[v30 + 1];
6210 dlau_texnames_by_face[pPlayers[v30 + 1]->uFace],
6211 TEXTURE_16BIT_PALETTE);
6212 papredoll_drhs[v30] = pIcons_LOD->LoadTexture(
6213 drh_texnames_by_face[pPlayers[v30 + 1]->uFace],
6214 TEXTURE_16BIT_PALETTE);
6215 papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(
6216 dlh_texnames_by_face[pPlayers[v30 + 1]->uFace],
6217 TEXTURE_16BIT_PALETTE);
6218 v7 = pIcons_LOD->LoadTexture(
6219 dlhu_texnames_by_face[pPlayers[v30 + 1]->uFace],
6220 TEXTURE_16BIT_PALETTE);
6221 v8 = pPlayers[v30 + 1];
6222 papredoll_dlhus[v30] = v7; 6549 papredoll_dlhus[v30] = v7;
6223 v9 = (char *)&v8->uFace; 6550 v9 = (char *)&pPlayer2->uFace;
6224 v10 = *v9; 6551 v10 = *v9;
6225 if ( *v9 == 12 || v10 == 13 ) 6552 if ( *v9 == 12 || v10 == 13 )
6226 { 6553 {
6227 wsprintfA(pContainer, "pc%02dbrd", v10 + 1); 6554 wsprintfA(pContainer, "pc%02dbrd", v10 + 1);
6228 v9 = (char *)&pPlayers[v6 + 1]->uFace; 6555 v9 = (char *)&pPlayers[v6 + 1]->uFace;
6248 do 6575 do
6249 { 6576 {
6250 byte_5111C0[v11] = 0; 6577 byte_5111C0[v11] = 0;
6251 if ( pParty->pPickedItem.uItemID != v11 + 66 ) 6578 if ( pParty->pPickedItem.uItemID != v11 + 66 )
6252 { 6579 {
6253 v12 = pParty->pPlayers; 6580 pPlayer3 = pParty->pPlayers;
6254 while ( !sub_43EE15_player_has_item(v11 + 66, v12, 0) ) 6581 while ( !sub_43EE15_player_has_item(v11 + 66, pPlayer3, 0) )
6255 { 6582 {
6256 ++v12; 6583 ++pPlayer3;
6257 if ( (signed int)v12 >= (signed int)pParty->pHirelings ) 6584 if ( (signed int)pPlayer3 >= (signed int)pParty->pHirelings )
6258 goto LABEL_28; 6585 goto LABEL_28;
6259 } 6586 }
6260 } 6587 }
6261 byte_5111C0[v11] = 1; 6588 byte_5111C0[v11] = 1;
6262 LABEL_28: 6589 LABEL_28:
6266 *(int *)byte_5111F6 = 0; 6593 *(int *)byte_5111F6 = 0;
6267 *(int *)&byte_5111F6[4] = 0; 6594 *(int *)&byte_5111F6[4] = 0;
6268 *(int *)&byte_5111F6[8] = 0; 6595 *(int *)&byte_5111F6[8] = 0;
6269 *(int *)&byte_5111F6[12] = 0; 6596 *(int *)&byte_5111F6[12] = 0;
6270 *(int *)&byte_5111F6[16] = 0; 6597 *(int *)&byte_5111F6[16] = 0;
6271 v13 = pParty->pPlayers; 6598 pPlayer4 = pParty->pPlayers;
6272 v14 = 1; 6599 v14 = 1;
6273 do 6600 do
6274 { 6601 {
6275 if ( sub_43EE15_player_has_item(0x204u, v13, 1) ) 6602 if ( sub_43EE15_player_has_item(0x204u, pPlayer4, 1) )
6276 byte_5111F6[2] = 1; 6603 byte_5111F6[2] = 1;
6277 if ( sub_43EE15_player_has_item(0x1F8u, v13, 1) ) 6604 if ( sub_43EE15_player_has_item(0x1F8u, pPlayer4, 1) )
6278 byte_5111F6[0] = 1; 6605 byte_5111F6[0] = 1;
6279 if ( sub_43EE15_player_has_item(0x1F9u, v13, 1) ) 6606 if ( sub_43EE15_player_has_item(0x1F9u, pPlayer4, 1) )
6280 byte_5111F6[1] = 1; 6607 byte_5111F6[1] = 1;
6281 if ( sub_43EE15_player_has_item(0x215u, v13, 1) ) 6608 if ( sub_43EE15_player_has_item(0x215u, pPlayer4, 1) )
6282 byte_5111F6[16] = 1; 6609 byte_5111F6[16] = 1;
6283 if ( sub_43EE15_player_has_item(0x200u, v13, 1) ) 6610 if ( sub_43EE15_player_has_item(0x200u, pPlayer4, 1) )
6284 byte_5111F6[3] = 1; 6611 byte_5111F6[3] = 1;
6285 if ( sub_43EE15_player_has_item(0x209u, v13, 1) ) 6612 if ( sub_43EE15_player_has_item(0x209u, pPlayer4, 1) )
6286 byte_5111F6[4] = 1; 6613 byte_5111F6[4] = 1;
6287 if ( sub_43EE15_player_has_item(0x20Au, v13, 1) ) 6614 if ( sub_43EE15_player_has_item(0x20Au, pPlayer4, 1) )
6288 byte_5111F6[5] = 1; 6615 byte_5111F6[5] = 1;
6289 if ( sub_43EE15_player_has_item(0x20Bu, v13, 1) ) 6616 if ( sub_43EE15_player_has_item(0x20Bu, pPlayer4, 1) )
6290 byte_5111F6[6] = 1; 6617 byte_5111F6[6] = 1;
6291 if ( sub_43EE15_player_has_item(0x214u, v13, 1) ) 6618 if ( sub_43EE15_player_has_item(0x214u, pPlayer4, 1) )
6292 byte_5111F6[7] = 1; 6619 byte_5111F6[7] = 1;
6293 if ( sub_43EE15_player_has_item(0x220u, v13, 1) ) 6620 if ( sub_43EE15_player_has_item(0x220u, pPlayer4, 1) )
6294 byte_5111F6[8] = 1; 6621 byte_5111F6[8] = 1;
6295 if ( sub_43EE15_player_has_item(0x20Cu, v13, 1) ) 6622 if ( sub_43EE15_player_has_item(0x20Cu, pPlayer4, 1) )
6296 byte_5111F6[9] = 1; 6623 byte_5111F6[9] = 1;
6297 if ( sub_43EE15_player_has_item(0x217u, v13, 1) ) 6624 if ( sub_43EE15_player_has_item(0x217u, pPlayer4, 1) )
6298 byte_5111F6[10] = 1; 6625 byte_5111F6[10] = 1;
6299 if ( sub_43EE15_player_has_item(0x20Du, v13, 1) ) 6626 if ( sub_43EE15_player_has_item(0x20Du, pPlayer4, 1) )
6300 byte_5111F6[11] = 1; 6627 byte_5111F6[11] = 1;
6301 if ( sub_43EE15_player_has_item(0x212u, v13, 1) ) 6628 if ( sub_43EE15_player_has_item(0x212u, pPlayer4, 1) )
6302 byte_5111F6[12] = 1; 6629 byte_5111F6[12] = 1;
6303 if ( sub_43EE15_player_has_item(0x223u, v13, 1) ) 6630 if ( sub_43EE15_player_has_item(0x223u, pPlayer4, 1) )
6304 byte_5111F6[13] = 1; 6631 byte_5111F6[13] = 1;
6305 if ( sub_43EE15_player_has_item(0x224u, v13, 1) ) 6632 if ( sub_43EE15_player_has_item(0x224u, pPlayer4, 1) )
6306 byte_5111F6[14] = 1; 6633 byte_5111F6[14] = 1;
6307 if ( sub_43EE15_player_has_item(0x226u, v13, 1) ) 6634 if ( sub_43EE15_player_has_item(0x226u, pPlayer4, 1) )
6308 byte_5111F6[15] = 1; 6635 byte_5111F6[15] = 1;
6309 ++v13; 6636 ++pPlayer4;
6310 } 6637 }
6311 while ( (signed int)v13 < (signed int)pParty->pHirelings ); 6638 while ( (signed int)pPlayer4 < (signed int)pParty->pHirelings );
6312 v15 = &stru_511698.field_2C; 6639 v15 = &stru_511698.field_2C;
6313 v35 = (char *)&stru_511718.field_18; 6640 v35 = (char *)&stru_511718.field_18;
6314 do 6641 do
6315 { 6642 {
6316 v16 = 0; 6643 v16 = 0;
6422 v34 = v43; 6749 v34 = v43;
6423 *v40 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6750 *v40 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6424 do 6751 do
6425 { 6752 {
6426 _43C91D_FormItemTextureFilename(pContainer, v38, v20, 0); 6753 _43C91D_FormItemTextureFilename(pContainer, v38, v20, 0);
6427 *(int *)((char *)paperdoll_array_511828 + v34) = pIcons_LOD->LoadTexture( 6754 *(int *)((char *)paperdoll_array_511828 + v34) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6428 pContainer,
6429 TEXTURE_16BIT_PALETTE);
6430 _43C91D_FormItemTextureFilename(pContainer, v38, v20, 1); 6755 _43C91D_FormItemTextureFilename(pContainer, v38, v20, 1);
6431 v27 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6756 v27 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6432 v28 = v34; 6757 v28 = v34;
6433 v34 += 4; 6758 v34 += 4;
6434 ++v38; 6759 ++v38;
6435 *(int *)((char *)dword_511788 + v28) = v27; 6760 *(int *)((char *)dword_511788 + v28) = v27;
6436 } 6761 }
6437 while ( v38 - 105 < 5 ); 6762 while ( v38 - 105 < 5 );
6438 _43C91D_FormItemTextureFilename(pContainer, 525, v20, 0); 6763 _43C91D_FormItemTextureFilename(pContainer, 525, v20, 0);
6439 *(int *)((char *)&paperdoll_array_511828[0][5] + v43) = pIcons_LOD->LoadTexture( 6764 *(int *)((char *)&paperdoll_array_511828[0][5] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6440 pContainer,
6441 TEXTURE_16BIT_PALETTE);
6442 _43C91D_FormItemTextureFilename(pContainer, 530, v20, 0); 6765 _43C91D_FormItemTextureFilename(pContainer, 530, v20, 0);
6443 *(int *)((char *)&paperdoll_array_511828[0][6] + v43) = pIcons_LOD->LoadTexture( 6766 *(int *)((char *)&paperdoll_array_511828[0][6] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6444 pContainer,
6445 TEXTURE_16BIT_PALETTE);
6446 _43C91D_FormItemTextureFilename(pContainer, 547, v20, 0); 6767 _43C91D_FormItemTextureFilename(pContainer, 547, v20, 0);
6447 *(int *)((char *)&paperdoll_array_511828[0][7] + v43) = pIcons_LOD->LoadTexture( 6768 *(int *)((char *)&paperdoll_array_511828[0][7] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6448 pContainer,
6449 TEXTURE_16BIT_PALETTE);
6450 _43C91D_FormItemTextureFilename(pContainer, 548, v20, 0); 6769 _43C91D_FormItemTextureFilename(pContainer, 548, v20, 0);
6451 *(int *)((char *)&paperdoll_array_511828[0][8] + v43) = pIcons_LOD->LoadTexture( 6770 *(int *)((char *)&paperdoll_array_511828[0][8] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6452 pContainer,
6453 TEXTURE_16BIT_PALETTE);
6454 _43C91D_FormItemTextureFilename(pContainer, 550, v20, 0); 6771 _43C91D_FormItemTextureFilename(pContainer, 550, v20, 0);
6455 *(int *)((char *)&paperdoll_array_511828[0][9] + v43) = pIcons_LOD->LoadTexture( 6772 *(int *)((char *)&paperdoll_array_511828[0][9] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6456 pContainer,
6457 TEXTURE_16BIT_PALETTE);
6458 _43C91D_FormItemTextureFilename(pContainer, 525, v20, 1); 6773 _43C91D_FormItemTextureFilename(pContainer, 525, v20, 1);
6459 *(int *)((char *)&dword_51179C + v43) = pIcons_LOD->LoadTexture( 6774 *(int *)((char *)&dword_51179C + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6460 pContainer,
6461 TEXTURE_16BIT_PALETTE);
6462 _43C91D_FormItemTextureFilename(pContainer, 530, v20, 1); 6775 _43C91D_FormItemTextureFilename(pContainer, 530, v20, 1);
6463 *(int *)((char *)&dword_5117A0 + v43) = pIcons_LOD->LoadTexture( 6776 *(int *)((char *)&dword_5117A0 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6464 pContainer,
6465 TEXTURE_16BIT_PALETTE);
6466 _43C91D_FormItemTextureFilename(pContainer, 547, v20, 1); 6777 _43C91D_FormItemTextureFilename(pContainer, 547, v20, 1);
6467 *(int *)((char *)&dword_5117A4 + v43) = pIcons_LOD->LoadTexture( 6778 *(int *)((char *)&dword_5117A4 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6468 pContainer,
6469 TEXTURE_16BIT_PALETTE);
6470 _43C91D_FormItemTextureFilename(pContainer, 548, v20, 1); 6779 _43C91D_FormItemTextureFilename(pContainer, 548, v20, 1);
6471 *(int *)((char *)&dword_5117A8 + v43) = pIcons_LOD->LoadTexture( 6780 *(int *)((char *)&dword_5117A8 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6472 pContainer,
6473 TEXTURE_16BIT_PALETTE);
6474 _43C91D_FormItemTextureFilename(pContainer, 550, v20, 1); 6781 _43C91D_FormItemTextureFilename(pContainer, 550, v20, 1);
6475 *(int *)((char *)&dword_5117AC + v43) = pIcons_LOD->LoadTexture( 6782 *(int *)((char *)&dword_5117AC + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6476 pContainer,
6477 TEXTURE_16BIT_PALETTE);
6478 } 6783 }
6479 else 6784 else
6480 { 6785 {
6481 v26 = v43; 6786 v26 = v43;
6482 } 6787 }
12930 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); 13235 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6);
12931 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; 13236 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
12932 dword_5063D8[v12] = result; 13237 dword_5063D8[v12] = result;
12933 } 13238 }
12934 v4 = v12 + 1; 13239 v4 = v12 + 1;
12935 v9 = __OFSUB__(v12 + 1, 12); 13240 v9 = v12++ > 12;//v9 = __OFSUB__(v12 + 1, 12);
12936 v8 = v12++ - 11 < 0; 13241 v8 = v12++ - 11 < 0;
12937 } 13242 }
12938 while ( v8 ^ v9 ); 13243 while ( v8 ^ v9 );
12939 return result; 13244 return result;
12940 } 13245 }
14828 if ( v37 )//pWindowType > 103 15133 if ( v37 )//pWindowType > 103
14829 { 15134 {
14830 v38 = v37 - 2; 15135 v38 = v37 - 2;
14831 if ( v38 )//pWindowType > 105 15136 if ( v38 )//pWindowType > 105
14832 { 15137 {
14833 if ( v38 == 1 )//pWindowType == 106 15138 if ( v38 == 1 )//pWindowType == 106 (0x6A) WINDOW_VideoOptions
14834 GameMenuUI_DrawVideoOptions(); 15139 GameMenuUI_DrawVideoOptions();
14835 } 15140 }
14836 else//pWindowType == 105 15141 else//pWindowType == 105
14837 { 15142 {
14838 GameMenuUI_DrawKeyBindings(); 15143 GameMenuUI_DrawKeyBindings();
17370 } 17675 }
17371 17676
17372 //----- (00419100) -------------------------------------------------------- 17677 //----- (00419100) --------------------------------------------------------
17373 int __cdecl sub_419100() 17678 int __cdecl sub_419100()
17374 { 17679 {
17375 Player *v0; // esi@1 17680 Player *pPlayer; // esi@1
17376 int v1; // ebx@1 17681 int v1; // ebx@1
17377 unsigned __int8 *v2; // esi@1 17682 unsigned __int8 *v2; // esi@1
17378 int v3; // eax@4 17683 int v3; // eax@4
17379 int result; // eax@6 17684 int result; // eax@6
17380 int v5; // esi@6 17685 int v5; // esi@6
17387 int v12; // edx@11 17692 int v12; // edx@11
17388 int v13; // [sp+Ch] [bp-8h]@2 17693 int v13; // [sp+Ch] [bp-8h]@2
17389 signed int v14; // [sp+Ch] [bp-8h]@9 17694 signed int v14; // [sp+Ch] [bp-8h]@9
17390 int i; // [sp+10h] [bp-4h]@10 17695 int i; // [sp+10h] [bp-4h]@10
17391 17696
17392 v0 = pPlayers[uActiveCharacter]; 17697 pPlayer = pPlayers[uActiveCharacter];
17393 memset(&pStru179, 0, 0xFA0u); 17698 memset(&pStru179, 0, 0xFA0u);
17394 memset(pTmpBuf2, 0, 0x7D0u); 17699 memset(pTmpBuf2, 0, 0x7D0u);
17395 v1 = 0; 17700 v1 = 0;
17396 dword_506544 = 0; 17701 dword_506544 = 0;
17397 dword_506548 = 0; 17702 dword_506548 = 0;
17398 dword_506520 = 0; 17703 dword_506520 = 0;
17399 dword_50651C = 0; 17704 dword_50651C = 0;
17400 dword_506528 = 0; 17705 dword_506528 = 0;
17401 v2 = (unsigned __int8 *)v0->field_152; 17706 v2 = (unsigned __int8 *)pPlayer->field_152;
17402 do 17707 do
17403 { 17708 {
17404 v13 = dword_723E80_award_related[2 * v1]; 17709 v13 = dword_723E80_award_related[2 * v1];
17405 if ( (unsigned __int16)_449B57_test_bit(v2, v1) && v13 ) 17710 if ( (unsigned __int16)_449B57_test_bit(v2, v1) && v13 )
17406 { 17711 {
17421 do 17726 do
17422 { 17727 {
17423 v8 = rand() % 16; 17728 v8 = rand() % 16;
17424 result = dword_506524; 17729 result = dword_506524;
17425 v9 = dword_506524 + v5++; 17730 v9 = dword_506524 + v5++;
17426 v10 = __OFSUB__(v5, dword_506524); 17731 v10 = v5 > dword_506524;//__OFSUB__(v5, dword_506524);
17427 v7 = v5 - dword_506524 < 0; 17732 v7 = v5 - dword_506524 < 0;
17428 pStru179->field_0[v9] = v8; 17733 pStru179->field_0[v9] = v8;
17429 } 17734 }
17430 while ( v7 ^ v10 ); 17735 while ( v7 ^ v10 );
17431 if ( result > 0 ) 17736 if ( result > 0 )