comparison GUIWindow.cpp @ 878:6f32de715e30

Merge
author Nomad
date Mon, 01 Apr 2013 16:44:33 +0200
parents 231523a39203
children 10fa7dad1391
comparison
equal deleted inserted replaced
877:84c8119c366a 878:6f32de715e30
1026 int v6; // edi@45 1026 int v6; // edi@45
1027 char *v7; // eax@45 1027 char *v7; // eax@45
1028 int v8; // edi@46 1028 int v8; // edi@46
1029 int v9; // eax@50 1029 int v9; // eax@50
1030 unsigned int v10; // [sp-10h] [bp-C8h]@53 1030 unsigned int v10; // [sp-10h] [bp-C8h]@53
1031 //unsigned __int16 v11; // [sp-Ch] [bp-C4h]@53 1031 char *pTitleText; // [sp-8h] [bp-C0h]@50
1032 //unsigned int v12; // [sp-Ch] [bp-C4h]@60
1033 char *v13; // [sp-8h] [bp-C0h]@50
1034 //unsigned int v14; // [sp-8h] [bp-C0h]@60
1035 unsigned int v15; // [sp-4h] [bp-BCh]@50
1036 //Texture *v16; // [sp-4h] [bp-BCh]@60
1037 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 1032 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4
1038 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 1033 GUIWindow pWindow; // [sp+60h] [bp-58h]@2
1039 int pColor2; // [sp+B4h] [bp-4h]@2 1034 int pColor2; // [sp+B4h] [bp-4h]@2
1040 1035
1041 if ( !window_SpeakInHouse ) 1036 if ( !window_SpeakInHouse )
1049 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_507B04]); 1044 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_507B04]);
1050 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) 1045 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic )
1051 { 1046 {
1052 pDialogWindow.uFrameWidth = 130; 1047 pDialogWindow.uFrameWidth = 130;
1053 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); 1048 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight);
1054
1055 //v2 = (const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C];
1056 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; 1049 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName;
1057
1058 if ( pHouseName ) 1050 if ( pHouseName )
1059 { 1051 {
1060 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); 1052 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0);
1061 if ( v3 < 0 ) 1053 if ( v3 < 0 )
1062 v3 = 0; 1054 v3 = 0;
1106 { 1098 {
1107 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 1099 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
1108 } 1100 }
1109 return; 1101 return;
1110 } 1102 }
1111 v8 = 0; 1103 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 )
1112 while ( 1 ) 1104 {
1113 {
1114 //pRenderer->DrawTextureIndexed(*(&pNPCPortraits_x + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
1115 // *(&pNPCPortraits_y + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
1116 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, 1105 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4,
1117 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); // frame around portrait 1106 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
1118 //pRenderer->DrawTextureIndexed(*(&pNPCPortraits_x + v8 + 6 * uNumDialogueNPCPortraits - 6),
1119 // *(&pNPCPortraits_y + v8 + 6 * uNumDialogueNPCPortraits - 6), pDialogueNPCPortraits[v8]);
1120 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], 1107 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8],
1121 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); 1108 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]);
1122 if ( uNumDialogueNPCPortraits < 4 ) 1109 if ( uNumDialogueNPCPortraits < 4 )
1123 break;
1124 LABEL_57:
1125 ++v8;
1126 if ( v8 >= uNumDialogueNPCPortraits )
1127 { 1110 {
1128 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) 1111 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic )
1129 { 1112 {
1130 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 1113 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName;
1131 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 1114 v9 = 94 * v8 + 113;
1132 } 1115 }
1133 else 1116 else
1134 { 1117 {
1135 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 1118 if ( !v8 && dword_591080 )
1119 {
1120 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle;
1121 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3);
1122 continue;
1123 }
1124 pTitleText = HouseNPCData[v8 - (dword_591080 != 0)]->pName;
1125 v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2;
1136 } 1126 }
1137 return; 1127 v10 = v9;
1138 } 1128 pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, pTitleText, 3);
1139 } 1129 }
1140 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) 1130 }
1141 { 1131 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
1142 v15 = 3;
1143 v13 = pMapStats->pInfos[uHouse_ExitPic].pName;
1144 v9 = 94 * v8 + 113;
1145 }
1146 else
1147 {
1148 if ( !v8 && dword_591080 )
1149 { 1132 {
1150 v15 = 3; 1133 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
1151 //v13 = (char *)p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]; 1134 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
1152 v13 = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; 1135 }
1153 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, v13, 3); 1136 else
1154 goto LABEL_57; 1137 {
1155 } 1138 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
1156 v15 = 3; 1139 }
1157 v13 = HouseNPCData[v8 - (dword_591080 != 0)]->pName; 1140 return;
1158 v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2;
1159 }
1160 //v11 = pColor2;
1161 v10 = v9;
1162 pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, v13, v15);
1163 goto LABEL_57;
1164 } 1141 }
1165 v4 = (char *)pDialogueNPCCount - 1; 1142 v4 = (char *)pDialogueNPCCount - 1;
1166 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); 1143 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
1167 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); 1144 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]);
1168 if ( pCurrentScreen == SCREEN_E ) 1145 if ( pCurrentScreen == SCREEN_E )
1252 else 1229 else
1253 { 1230 {
1254 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 1231 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
1255 } 1232 }
1256 } 1233 }
1257
1258 1234
1259 //----- (004B1854) -------------------------------------------------------- 1235 //----- (004B1854) --------------------------------------------------------
1260 void GUIWindow::DrawCurrentTime( __int64 a2 ) 1236 void GUIWindow::DrawCurrentTime( __int64 a2 )
1261 { 1237 {
1262 unsigned int v2; // edi@1 1238 unsigned int v2; // edi@1
1955 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); 1931 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
1956 v25 = uNumDialogueNPCPortraits; 1932 v25 = uNumDialogueNPCPortraits;
1957 v26 = 0; 1933 v26 = 0;
1958 if ( uNumDialogueNPCPortraits > 0 ) 1934 if ( uNumDialogueNPCPortraits > 0 )
1959 { 1935 {
1960 do 1936 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 )
1961 { 1937 {
1962 uWidtha = v26 + 1;
1963 if ( v26 + 1 == v25 && uHouse_ExitPic ) 1938 if ( v26 + 1 == v25 && uHouse_ExitPic )
1964 { 1939 {
1965 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; 1940 v30 = pMapStats->pInfos[uHouse_ExitPic].pName;
1966 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S];//Войти в ^Pv[%s] 1941 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S];
1967 } 1942 }
1968 else 1943 else
1969 { 1944 {
1970 if ( v26 || !dword_591080 ) 1945 if ( v26 || !dword_591080 )
1971 v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName;//problem in Harmondale tavern(v26 == 0) 1946 v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName;
1972 else 1947 else
1973 //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; 1948 //v27 = (char *)p2DEvents_minus1_::08[13 * a4];
1974 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; 1949 v27 = (char *)p2DEvents[pButton - 1].pProprieterName;
1975 v30 = v27; 1950 v30 = v27;
1976 v29 = (char*)pGlobalTXT_LocalizationStrings[435];// "Converse with %s" Побеседовать с ^Pt[%s] 1951 v29 = (char*)pGlobalTXT_LocalizationStrings[435];
1977 } 1952 }
1978 sprintfex(byte_591180[v26], v29, v30); 1953 sprintfex(byte_591180[v26], v29, v30);
1979 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], 1954 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26],
1980 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], 1955 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26],
1981 0x3Fu, 0x49u, 1, 0, UIMSG_19A, v26, 0, byte_591180[v26], 0, 0, 0); 1956 0x3Fu, 0x49u, 1, 0, UIMSG_19A, v26, 0, byte_591180[v26], 0, 0, 0);
1982 ++v26;
1983 v25 = uNumDialogueNPCPortraits; 1957 v25 = uNumDialogueNPCPortraits;
1984 } 1958 }
1985 while ( uWidtha < uNumDialogueNPCPortraits );
1986 } 1959 }
1987 if ( v25 == 1 ) 1960 if ( v25 == 1 )
1988 { 1961 {
1989 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; 1962 window_SpeakInHouse = &pWindowList[uNextFreeWindowID];
1990 _4B4224_UpdateNPCTopics(0); 1963 _4B4224_UpdateNPCTopics(0);