Mercurial > mm7
comparison UI/UiGame.cpp @ 2017:a5a3ad2713b2
WritePointedObjectStatusString(continue)2
author | Ritor1 |
---|---|
date | Mon, 11 Nov 2013 17:37:38 +0600 |
parents | f39f27b08908 |
children | 4c3e8ec07d12 |
comparison
equal
deleted
inserted
replaced
2016:f1fd2ed4e9ba | 2017:a5a3ad2713b2 |
---|---|
1164 | 1164 |
1165 int interaction_distance_limit = 512; | 1165 int interaction_distance_limit = 512; |
1166 | 1166 |
1167 pMouse->uPointingObjectID = 0; | 1167 pMouse->uPointingObjectID = 0; |
1168 pMouse->GetClickPos(&pX, &pY); | 1168 pMouse->GetClickPos(&pX, &pY); |
1169 if ( pX < 0 || pX > 639 || pY < 0 || pY > 479 ) | 1169 if ( pX < 0 || pX > 639 || pY < 0 || pY > 479 )//границы окна игры |
1170 return; | 1170 return; |
1171 if (pCurrentScreen == SCREEN_GAME) | 1171 if ( pX <= 467 && pY <= 351 )//пределы основной области |
1172 { | 1172 { |
1173 if ( pX > 467 || pY > 351 ) | 1173 //окно(область) игры---------------------------------- |
1174 goto _click_on_game_ui; | 1174 if ( pCurrentScreen == SCREEN_GAME ) |
1175 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 | 1175 { |
1176 { | 1176 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
1177 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 1177 { |
1178 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X | 1178 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1179 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) | 1179 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X |
1180 v18 = -1; | 1180 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) |
1181 if ( v18 == -1 ) | 1181 v18 = -1; |
1182 { | 1182 if ( v18 == -1 ) |
1183 pMouse->uPointingObjectID = 0; | 1183 { |
1184 if ( pMouse->uPointingObjectID == 0 ) | 1184 pMouse->uPointingObjectID = 0; |
1185 { | |
1186 if ( uLastPointedObjectID != 0 ) | |
1187 { | |
1188 pFooterString[0] = 0; | |
1189 bForceDrawFooter = 1; | |
1190 } | |
1191 } | |
1192 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1193 return; | |
1194 } | |
1195 } | |
1196 else | |
1197 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1198 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
1199 v19 = (signed)PID_ID(v18); | |
1200 //For Items------------------------------------ | |
1201 if (PID_TYPE(v18) == OBJECT_Item) | |
1202 { | |
1203 if ( pObjectList->pObjects[pSpriteObjects[v19].uObjectDescID].uFlags & 0x10 ) | |
1204 { | |
1205 pMouse->uPointingObjectID = 0; | |
1206 pFooterString[0] = 0; | |
1207 bForceDrawFooter = 1; | |
1208 uLastPointedObjectID = 0; | |
1209 return; | |
1210 } | |
1211 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | |
1212 { | |
1213 GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); | |
1214 if ( pMouse->uPointingObjectID == 0 ) | |
1215 { | |
1216 if ( uLastPointedObjectID != 0 ) | |
1217 { | |
1218 pFooterString[0] = 0; | |
1219 bForceDrawFooter = 1; | |
1220 } | |
1221 } | |
1222 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1223 return; | |
1224 } | |
1225 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" | |
1226 GameUI_SetFooterString(pTmpBuf.data()); | |
1227 if ( pMouse->uPointingObjectID == 0 ) | |
1228 { | |
1229 if ( uLastPointedObjectID != 0 ) | |
1230 { | |
1231 pFooterString[0] = 0; | |
1232 bForceDrawFooter = 1; | |
1233 } | |
1234 } | |
1235 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1236 return; | |
1237 } | |
1238 //For Decorations---------------------------------- | |
1239 if (PID_TYPE(v18) == OBJECT_Decoration) | |
1240 { | |
1241 if ( !pLevelDecorations[v19].uEventID ) | |
1242 { | |
1243 if ( pLevelDecorations[v19].IsInteractive() ) | |
1244 pText = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 379].pTopic;//неверно для костра | |
1245 else | |
1246 pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; | |
1247 GameUI_SetFooterString(pText); | |
1248 if ( pMouse->uPointingObjectID == 0 ) | |
1249 { | |
1250 if ( uLastPointedObjectID != 0 ) | |
1251 { | |
1252 pFooterString[0] = 0; | |
1253 bForceDrawFooter = 1; | |
1254 } | |
1255 } | |
1256 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1257 return; | |
1258 } | |
1259 if ( !GetEventHintString(pLevelDecorations[v19].uEventID) ) | |
1260 { | |
1261 if ( pMouse->uPointingObjectID == 0 ) | |
1262 { | |
1263 if ( uLastPointedObjectID != 0 ) | |
1264 { | |
1265 pFooterString[0] = 0; | |
1266 bForceDrawFooter = 1; | |
1267 } | |
1268 } | |
1269 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1270 return; | |
1271 } | |
1272 GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); | |
1273 if ( pMouse->uPointingObjectID == 0 ) | |
1274 { | |
1275 if ( uLastPointedObjectID != 0 ) | |
1276 { | |
1277 pFooterString[0] = 0; | |
1278 bForceDrawFooter = 1; | |
1279 } | |
1280 } | |
1281 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1282 return; | |
1283 } | |
1284 //For 3D Model------------------------------------- | |
1285 if (PID_TYPE(v18) == OBJECT_BModel) | |
1286 { | |
1287 if ( HIWORD(v18) < interaction_distance_limit ) | |
1288 { | |
1289 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
1290 { | |
1291 v18b = (signed int)(unsigned __int16)v18 >> 9; | |
1292 if ( !pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID | |
1293 || !GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID) ) | |
1294 { | |
1295 pMouse->uPointingObjectID = 0; | |
1296 pFooterString[0] = 0; | |
1297 bForceDrawFooter = 1; | |
1298 uLastPointedObjectID = 0; | |
1299 return; | |
1300 } | |
1301 GameUI_SetFooterString(GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID)); | |
1302 if ( pMouse->uPointingObjectID == 0 ) | 1185 if ( pMouse->uPointingObjectID == 0 ) |
1303 { | 1186 { |
1304 if ( uLastPointedObjectID != 0 ) | 1187 if ( uLastPointedObjectID != 0 ) |
1305 { | 1188 { |
1306 pFooterString[0] = 0; | 1189 pFooterString[0] = 0; |
1308 } | 1191 } |
1309 } | 1192 } |
1310 uLastPointedObjectID = pMouse->uPointingObjectID; | 1193 uLastPointedObjectID = pMouse->uPointingObjectID; |
1311 return; | 1194 return; |
1312 } | 1195 } |
1313 pFace = &pIndoor->pFaces[v19]; | 1196 } |
1314 if ( BYTE3(pFace->uAttributes) & 6 ) | 1197 else |
1315 { | 1198 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; |
1316 if ( !pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID | 1199 pMouse->uPointingObjectID = (unsigned __int16)v18; |
1317 || !GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID) ) | 1200 v19 = (signed)PID_ID(v18); |
1318 { | 1201 //For Items------------------------------------ |
1319 pMouse->uPointingObjectID = 0; | 1202 if (PID_TYPE(v18) == OBJECT_Item) |
1320 pFooterString[0] = 0; | 1203 { |
1321 bForceDrawFooter = 1; | 1204 if ( pObjectList->pObjects[pSpriteObjects[v19].uObjectDescID].uFlags & 0x10 ) |
1322 uLastPointedObjectID = 0; | 1205 { |
1323 return; | 1206 pMouse->uPointingObjectID = 0; |
1324 } | 1207 pFooterString[0] = 0; |
1325 GameUI_SetFooterString(GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID)); | 1208 bForceDrawFooter = 1; |
1209 uLastPointedObjectID = 0; | |
1210 return; | |
1211 } | |
1212 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | |
1213 { | |
1214 GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); | |
1326 if ( pMouse->uPointingObjectID == 0 ) | 1215 if ( pMouse->uPointingObjectID == 0 ) |
1327 { | 1216 { |
1328 if ( uLastPointedObjectID != 0 ) | 1217 if ( uLastPointedObjectID != 0 ) |
1329 { | 1218 { |
1330 pFooterString[0] = 0; | 1219 pFooterString[0] = 0; |
1332 } | 1221 } |
1333 } | 1222 } |
1334 uLastPointedObjectID = pMouse->uPointingObjectID; | 1223 uLastPointedObjectID = pMouse->uPointingObjectID; |
1335 return; | 1224 return; |
1336 } | 1225 } |
1337 } | 1226 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" |
1338 pMouse->uPointingObjectID = 0; | 1227 GameUI_SetFooterString(pTmpBuf.data()); |
1339 pFooterString[0] = 0; | |
1340 bForceDrawFooter = 1; | |
1341 uLastPointedObjectID = 0; | |
1342 return; | |
1343 } | |
1344 else | |
1345 { | |
1346 if (PID_TYPE(v18) != OBJECT_Actor) | |
1347 { | |
1348 pMouse->uPointingObjectID = 0; | |
1349 if ( uLastPointedObjectID != 0 ) | |
1350 { | |
1351 pFooterString[0] = 0; | |
1352 bForceDrawFooter = 1; | |
1353 } | |
1354 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1355 return; | |
1356 } | |
1357 if ( v18 >= 335544320 ) | |
1358 { | |
1359 pMouse->uPointingObjectID = 0; | |
1360 if ( pMouse->uPointingObjectID == 0 ) | 1228 if ( pMouse->uPointingObjectID == 0 ) |
1361 { | 1229 { |
1362 if ( uLastPointedObjectID != 0 ) | 1230 if ( uLastPointedObjectID != 0 ) |
1363 { | 1231 { |
1364 pFooterString[0] = 0; | 1232 pFooterString[0] = 0; |
1366 } | 1234 } |
1367 } | 1235 } |
1368 uLastPointedObjectID = pMouse->uPointingObjectID; | 1236 uLastPointedObjectID = pMouse->uPointingObjectID; |
1369 return; | 1237 return; |
1370 } | 1238 } |
1371 v28 = pTmpBuf.data(); | 1239 //For Decorations---------------------------------- |
1372 if ( pActors[v19].dword_000334_unique_name ) | 1240 if (PID_TYPE(v18) == OBJECT_Decoration) |
1373 pText = pMonsterStats->pPlaceStrings[pActors[v19].dword_000334_unique_name]; | 1241 { |
1374 else | 1242 if ( !pLevelDecorations[v19].uEventID ) |
1375 pText = pMonsterStats->pInfos[pActors[v19].pMonsterInfo.uID].pName; | 1243 { |
1376 strncpy(pTmpBuf.data(), pText, 0x7D0u); | 1244 if ( pLevelDecorations[v19].IsInteractive() ) |
1377 } | 1245 pText = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 379].pTopic;//неверно для костра |
1378 GameUI_SetFooterString(v28); | 1246 else |
1379 if ( pMouse->uPointingObjectID == 0 ) | 1247 pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; |
1380 { | 1248 GameUI_SetFooterString(pText); |
1381 if ( uLastPointedObjectID != 0 ) | 1249 if ( pMouse->uPointingObjectID == 0 ) |
1382 { | 1250 { |
1251 if ( uLastPointedObjectID != 0 ) | |
1252 { | |
1253 pFooterString[0] = 0; | |
1254 bForceDrawFooter = 1; | |
1255 } | |
1256 } | |
1257 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1258 return; | |
1259 } | |
1260 if ( !GetEventHintString(pLevelDecorations[v19].uEventID) ) | |
1261 { | |
1262 if ( pMouse->uPointingObjectID == 0 ) | |
1263 { | |
1264 if ( uLastPointedObjectID != 0 ) | |
1265 { | |
1266 pFooterString[0] = 0; | |
1267 bForceDrawFooter = 1; | |
1268 } | |
1269 } | |
1270 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1271 return; | |
1272 } | |
1273 GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); | |
1274 if ( pMouse->uPointingObjectID == 0 ) | |
1275 { | |
1276 if ( uLastPointedObjectID != 0 ) | |
1277 { | |
1278 pFooterString[0] = 0; | |
1279 bForceDrawFooter = 1; | |
1280 } | |
1281 } | |
1282 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1283 return; | |
1284 } | |
1285 //For 3D Model------------------------------------- | |
1286 if (PID_TYPE(v18) == OBJECT_BModel) | |
1287 { | |
1288 if ( HIWORD(v18) < interaction_distance_limit ) | |
1289 { | |
1290 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
1291 { | |
1292 v18b = (signed int)(unsigned __int16)v18 >> 9; | |
1293 if ( !pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID | |
1294 || !GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID) ) | |
1295 { | |
1296 pMouse->uPointingObjectID = 0; | |
1297 pFooterString[0] = 0; | |
1298 bForceDrawFooter = 1; | |
1299 uLastPointedObjectID = 0; | |
1300 return; | |
1301 } | |
1302 GameUI_SetFooterString(GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID)); | |
1303 if ( pMouse->uPointingObjectID == 0 ) | |
1304 { | |
1305 if ( uLastPointedObjectID != 0 ) | |
1306 { | |
1307 pFooterString[0] = 0; | |
1308 bForceDrawFooter = 1; | |
1309 } | |
1310 } | |
1311 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1312 return; | |
1313 } | |
1314 pFace = &pIndoor->pFaces[v19]; | |
1315 if ( BYTE3(pFace->uAttributes) & 6 ) | |
1316 { | |
1317 if ( !pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID | |
1318 || !GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID) ) | |
1319 { | |
1320 pMouse->uPointingObjectID = 0; | |
1321 pFooterString[0] = 0; | |
1322 bForceDrawFooter = 1; | |
1323 uLastPointedObjectID = 0; | |
1324 return; | |
1325 } | |
1326 GameUI_SetFooterString(GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID)); | |
1327 if ( pMouse->uPointingObjectID == 0 ) | |
1328 { | |
1329 if ( uLastPointedObjectID != 0 ) | |
1330 { | |
1331 pFooterString[0] = 0; | |
1332 bForceDrawFooter = 1; | |
1333 } | |
1334 } | |
1335 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1336 return; | |
1337 } | |
1338 } | |
1339 pMouse->uPointingObjectID = 0; | |
1383 pFooterString[0] = 0; | 1340 pFooterString[0] = 0; |
1384 bForceDrawFooter = 1; | 1341 bForceDrawFooter = 1; |
1385 } | 1342 uLastPointedObjectID = 0; |
1386 } | 1343 return; |
1387 uLastPointedObjectID = pMouse->uPointingObjectID; | 1344 } |
1388 return; | 1345 else |
1389 } | 1346 { |
1390 | 1347 if (PID_TYPE(v18) != OBJECT_Actor) |
1391 for ( v1 = uNumVisibleWindows; v1 > 0; --v1 ) // some other fullscreen ui | 1348 { |
1392 { | 1349 pMouse->uPointingObjectID = 0; |
1393 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | 1350 if ( uLastPointedObjectID != 0 ) |
1351 { | |
1352 pFooterString[0] = 0; | |
1353 bForceDrawFooter = 1; | |
1354 } | |
1355 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1356 return; | |
1357 } | |
1358 if ( v18 >= 335544320 ) | |
1359 { | |
1360 pMouse->uPointingObjectID = 0; | |
1361 if ( pMouse->uPointingObjectID == 0 ) | |
1362 { | |
1363 if ( uLastPointedObjectID != 0 ) | |
1364 { | |
1365 pFooterString[0] = 0; | |
1366 bForceDrawFooter = 1; | |
1367 } | |
1368 } | |
1369 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1370 return; | |
1371 } | |
1372 v28 = pTmpBuf.data(); | |
1373 if ( pActors[v19].dword_000334_unique_name ) | |
1374 pText = pMonsterStats->pPlaceStrings[pActors[v19].dword_000334_unique_name]; | |
1375 else | |
1376 pText = pMonsterStats->pInfos[pActors[v19].pMonsterInfo.uID].pName; | |
1377 strncpy(pTmpBuf.data(), pText, 0x7D0u); | |
1378 } | |
1379 GameUI_SetFooterString(v28); | |
1380 if ( pMouse->uPointingObjectID == 0 ) | |
1381 { | |
1382 if ( uLastPointedObjectID != 0 ) | |
1383 { | |
1384 pFooterString[0] = 0; | |
1385 bForceDrawFooter = 1; | |
1386 } | |
1387 } | |
1388 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1389 return; | |
1390 } | |
1391 //окно(область) ящика------------------------------------------- | |
1392 if ( pCurrentScreen == SCREEN_CHEST ) | |
1393 { | |
1394 //ChestUI_WritePointedObjectStatusString(); нужно исправить | |
1395 if ( pMouse->uPointingObjectID == 0 ) | |
1396 { | |
1397 if ( uLastPointedObjectID != 0 ) | |
1398 { | |
1399 pFooterString[0] = 0; | |
1400 bForceDrawFooter = 1; | |
1401 } | |
1402 } | |
1403 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1404 return; | |
1405 } | |
1406 //окно(область) магазина----------------------------------------- | |
1407 if ( pCurrentScreen == SCREEN_HOUSE ) | |
1408 { | |
1409 v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1410 if ( v16 != 0 && v16 != -65536 ) | |
1411 { | |
1412 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD ) | |
1413 { | |
1414 pItemGen = &pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v16-1]; | |
1415 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1416 uLastPointedObjectID = 1; | |
1417 } | |
1418 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) | |
1419 { | |
1420 pItemGen = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v16-1]; | |
1421 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1422 uLastPointedObjectID = 1; | |
1423 } | |
1424 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL ) | |
1425 { | |
1426 pItemGen = &pPlayers[uActiveCharacter]->pInventoryItemList[v16-1]; | |
1427 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1428 uLastPointedObjectID = 1; | |
1429 } | |
1430 } | |
1431 if ( pMouse->uPointingObjectID == 0 ) | |
1432 { | |
1433 if ( uLastPointedObjectID != 0 ) | |
1434 { | |
1435 pFooterString[0] = 0; | |
1436 bForceDrawFooter = 1; | |
1437 } | |
1438 } | |
1439 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1440 return; | |
1441 } | |
1442 //----------------------------------------- | |
1443 for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui | |
1444 { | |
1445 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
1446 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ | |
1447 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1448 { | |
1449 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
1450 { | |
1451 if ( !pButton ) | |
1452 break; | |
1453 switch ( pButton->uButtonType ) | |
1454 { | |
1455 case 1://for dialogue window | |
1456 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1457 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1458 { | |
1459 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1460 if ( pMessageType1 ) | |
1461 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1462 GameUI_SetFooterString(pButton->pButtonName); | |
1463 uLastPointedObjectID = 1; | |
1464 return; | |
1465 } | |
1466 break; | |
1467 case 2: | |
1468 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1469 && pY >= pButton->uY && pY <= pButton->uW ) | |
1470 { | |
1471 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1472 if ( pMessageType1 ) | |
1473 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1474 GameUI_SetFooterString(pButton->pButtonName); | |
1475 uLastPointedObjectID = 1; | |
1476 return; | |
1477 } | |
1478 break; | |
1479 case 3:// click on skill | |
1480 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1481 && pY >= pButton->uY && pY <= pButton->uW ) | |
1482 { | |
1483 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1484 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1485 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1486 else | |
1487 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1488 GameUI_SetFooterString(Str1); | |
1489 uLastPointedObjectID = 1; | |
1490 return; | |
1491 } | |
1492 break; | |
1493 } | |
1494 } | |
1495 } | |
1496 } | |
1497 //конец пределов основного экрана------------------------ | |
1498 } | |
1499 for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui | |
1500 { | |
1501 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
1394 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ | 1502 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ |
1395 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | 1503 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) |
1396 { | 1504 { |
1397 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | 1505 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) |
1398 { | 1506 { |
1440 break; | 1548 break; |
1441 } | 1549 } |
1442 } | 1550 } |
1443 } | 1551 } |
1444 } | 1552 } |
1445 | 1553 pMouse->uPointingObjectID = sub_46A99B(); |
1446 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | 1554 if ( pMouse->uPointingObjectID == 0 ) |
1447 { | 1555 { |
1448 if ( pCurrentScreen == SCREEN_CHEST ) | 1556 if ( uLastPointedObjectID != 0 ) |
1449 { | 1557 { |
1450 ChestUI_WritePointedObjectStatusString(); | 1558 pFooterString[0] = 0; |
1451 if ( pMouse->uPointingObjectID == 0 ) | 1559 bForceDrawFooter = 1; |
1452 { | 1560 } |
1453 if ( uLastPointedObjectID != 0 ) | 1561 } |
1454 { | 1562 uLastPointedObjectID = pMouse->uPointingObjectID; |
1455 pFooterString[0] = 0; | 1563 return; |
1456 bForceDrawFooter = 1; | |
1457 } | |
1458 } | |
1459 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1460 return; | |
1461 } | |
1462 if ( pCurrentScreen == SCREEN_HOUSE ) | |
1463 { | |
1464 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD | |
1465 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | |
1466 || v16 == -65536 ) | |
1467 { | |
1468 if ( pMouse->uPointingObjectID == 0 ) | |
1469 { | |
1470 if ( uLastPointedObjectID != 0 ) | |
1471 { | |
1472 pFooterString[0] = 0; | |
1473 bForceDrawFooter = 1; | |
1474 } | |
1475 } | |
1476 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1477 return; | |
1478 } | |
1479 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | |
1480 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1481 uLastPointedObjectID = 1; | |
1482 if ( pMouse->uPointingObjectID == 0 ) | |
1483 { | |
1484 if ( uLastPointedObjectID != 0 ) | |
1485 { | |
1486 pFooterString[0] = 0; | |
1487 bForceDrawFooter = 1; | |
1488 } | |
1489 } | |
1490 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1491 return; | |
1492 } | |
1493 if ( (signed int)pY < 350 ) | |
1494 { | |
1495 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1496 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
1497 { | |
1498 if ( pMouse->uPointingObjectID == 0 ) | |
1499 { | |
1500 if ( uLastPointedObjectID != 0 ) | |
1501 { | |
1502 pFooterString[0] = 0; | |
1503 bForceDrawFooter = 1; | |
1504 } | |
1505 } | |
1506 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1507 return; | |
1508 } | |
1509 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; | |
1510 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1511 uLastPointedObjectID = 1; | |
1512 if ( pMouse->uPointingObjectID == 0 ) | |
1513 { | |
1514 if ( uLastPointedObjectID != 0 ) | |
1515 { | |
1516 pFooterString[0] = 0; | |
1517 bForceDrawFooter = 1; | |
1518 } | |
1519 } | |
1520 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1521 return; | |
1522 } | |
1523 _click_on_game_ui: | |
1524 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
1525 && (signed int)pY >= (signed int)pWindowList[0].uFrameY && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
1526 { | |
1527 for ( pButton = pWindowList[0].pControlsHead; ; pButton = pButton->pNext ) | |
1528 { | |
1529 if ( !pButton ) | |
1530 break; | |
1531 switch ( pButton->uButtonType ) | |
1532 { | |
1533 case 1: | |
1534 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1535 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1536 { | |
1537 pMessageType3 = (UIMessageType)pButton->field_1C; | |
1538 if ( pMessageType3 == 0 ) // For books | |
1539 { | |
1540 GameUI_SetFooterString(pButton->pButtonName); | |
1541 uLastPointedObjectID = 1; | |
1542 return; | |
1543 } | |
1544 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | |
1545 uLastPointedObjectID = 1; | |
1546 return; | |
1547 } | |
1548 break; | |
1549 case 2: | |
1550 if (pX >= pButton->uX && pX <= pButton->uZ && | |
1551 pY >= pButton->uY && pY <= pButton->uW) | |
1552 { | |
1553 pMessageType2 = (UIMessageType)pButton->field_1C; | |
1554 if ( pMessageType2 != 0 ) | |
1555 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); | |
1556 GameUI_SetFooterString(pButton->pButtonName); // for character name | |
1557 uLastPointedObjectID = 1; | |
1558 return; | |
1559 } | |
1560 break; | |
1561 case 3: | |
1562 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1563 && pY >= pButton->uY && pY <= pButton->uW ) | |
1564 { | |
1565 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1566 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1567 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1568 else | |
1569 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1570 GameUI_SetFooterString(Str1); | |
1571 uLastPointedObjectID = 1; | |
1572 return; | |
1573 } | |
1574 break; | |
1575 } | |
1576 } | |
1577 } | |
1578 pMouse->uPointingObjectID = sub_46A99B(); | |
1579 if ( pMouse->uPointingObjectID == 0 ) | |
1580 { | |
1581 if ( uLastPointedObjectID != 0 ) | |
1582 { | |
1583 pFooterString[0] = 0; | |
1584 bForceDrawFooter = 1; | |
1585 } | |
1586 } | |
1587 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1588 return; | |
1589 } | |
1590 } | 1564 } |
1591 | 1565 |
1592 //----- (0044158F) -------------------------------------------------------- | 1566 //----- (0044158F) -------------------------------------------------------- |
1593 void GameUI_DrawCharacterSelectionFrame() | 1567 void GameUI_DrawCharacterSelectionFrame() |
1594 { | 1568 { |