Mercurial > mm7
comparison UI/UiGame.cpp @ 2012:f39f27b08908
WritePointedObjectStatusString(continue)
author | Ritor1 |
---|---|
date | Sun, 10 Nov 2013 23:08:20 +0600 |
parents | 37f42cfc881d |
children | a5a3ad2713b2 |
comparison
equal
deleted
inserted
replaced
2011:0449821c27e7 | 2012:f39f27b08908 |
---|---|
1385 } | 1385 } |
1386 } | 1386 } |
1387 uLastPointedObjectID = pMouse->uPointingObjectID; | 1387 uLastPointedObjectID = pMouse->uPointingObjectID; |
1388 return; | 1388 return; |
1389 } | 1389 } |
1390 v1 = uNumVisibleWindows; | 1390 |
1391 if ( uNumVisibleWindows > 0 ) | 1391 for ( v1 = uNumVisibleWindows; v1 > 0; --v1 ) // some other fullscreen ui |
1392 { | 1392 { |
1393 while ( 1 ) // some other fullscreen ui | 1393 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; |
1394 { | 1394 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ |
1395 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | 1395 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) |
1396 if ( (signed int)pX >= (signed int)pWindow->uFrameX | 1396 { |
1397 && (signed int)pX <= (signed int)pWindow->uFrameZ | 1397 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) |
1398 && (signed int)pY >= (signed int)pWindow->uFrameY | 1398 { |
1399 && (signed int)pY <= (signed int)pWindow->uFrameW ) | 1399 if ( !pButton ) |
1400 { | 1400 break; |
1401 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | 1401 switch ( pButton->uButtonType ) |
1402 { | 1402 { |
1403 if ( !pButton ) | 1403 case 1://for dialogue window |
1404 break; | 1404 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ |
1405 if ( pButton->uButtonType == 1 )//for dialogue window | 1405 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) |
1406 { | 1406 { |
1407 if ( (signed int)pX >= (signed int)pButton->uX | 1407 pMessageType1 = (UIMessageType)pButton->field_1C; |
1408 && (signed int)pX <= (signed int)pButton->uZ | 1408 if ( pMessageType1 ) |
1409 && (signed int)pY >= (signed int)pButton->uY | 1409 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
1410 && (signed int)pY <= (signed int)pButton->uW ) | 1410 GameUI_SetFooterString(pButton->pButtonName); |
1411 { | 1411 uLastPointedObjectID = 1; |
1412 pMessageType1 = (UIMessageType)pButton->field_1C; | 1412 return; |
1413 if ( pMessageType1 ) | 1413 } |
1414 { | 1414 break; |
1415 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | 1415 case 2: |
1416 } | 1416 if ( pX >= pButton->uX && pX <= pButton->uZ |
1417 GameUI_SetFooterString(pButton->pButtonName); | 1417 && pY >= pButton->uY && pY <= pButton->uW ) |
1418 uLastPointedObjectID = 1; | 1418 { |
1419 return; | 1419 pMessageType1 = (UIMessageType)pButton->field_1C; |
1420 } | 1420 if ( pMessageType1 ) |
1421 } | 1421 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
1422 else | 1422 GameUI_SetFooterString(pButton->pButtonName); |
1423 { | 1423 uLastPointedObjectID = 1; |
1424 if ( pButton->uButtonType == 2 ) | 1424 return; |
1425 { | 1425 } |
1426 v45 = pX - pButton->uX; | 1426 break; |
1427 v45 = pY - pButton->uY; | 1427 case 3:// click on skill |
1428 if ( (double)(signed int)pButton->uWidth != 0.0 ) | 1428 if ( pX >= pButton->uX && pX <= pButton->uZ |
1429 { | 1429 && pY >= pButton->uY && pY <= pButton->uW ) |
1430 if ( (double)(signed int)pButton->uHeight != 0.0 ) | 1430 { |
1431 { | 1431 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; |
1432 pMessageType1 = (UIMessageType)pButton->field_1C; | 1432 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) |
1433 if ( pMessageType1 ) | 1433 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" |
1434 { | 1434 else |
1435 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | 1435 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" |
1436 } | 1436 GameUI_SetFooterString(Str1); |
1437 GameUI_SetFooterString(pButton->pButtonName); | 1437 uLastPointedObjectID = 1; |
1438 uLastPointedObjectID = 1; | 1438 return; |
1439 return; | 1439 } |
1440 //} | 1440 break; |
1441 } | 1441 } |
1442 } | 1442 } |
1443 } | 1443 } |
1444 else // click on skill | 1444 } |
1445 { | 1445 |
1446 if ( pButton->uButtonType == 3 && pX >= pButton->uX && pX <= pButton->uZ && pY >= pButton->uY && pY <= pButton->uW ) | |
1447 { | |
1448 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1449 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1450 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1451 else | |
1452 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1453 GameUI_SetFooterString(Str1); | |
1454 uLastPointedObjectID = 1; | |
1455 return; | |
1456 } | |
1457 } | |
1458 } | |
1459 } | |
1460 } | |
1461 if ( pWindow->uFrameHeight == 480 ) | |
1462 break; | |
1463 --v1; | |
1464 if ( v1 <= 0 ) | |
1465 { | |
1466 break; | |
1467 } | |
1468 } | |
1469 } | |
1470 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | 1446 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) |
1471 { | 1447 { |
1472 if ( pCurrentScreen == SCREEN_CHEST ) | 1448 if ( pCurrentScreen == SCREEN_CHEST ) |
1473 { | 1449 { |
1474 ChestUI_WritePointedObjectStatusString(); | 1450 ChestUI_WritePointedObjectStatusString(); |
1543 } | 1519 } |
1544 uLastPointedObjectID = pMouse->uPointingObjectID; | 1520 uLastPointedObjectID = pMouse->uPointingObjectID; |
1545 return; | 1521 return; |
1546 } | 1522 } |
1547 _click_on_game_ui: | 1523 _click_on_game_ui: |
1548 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | 1524 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX && (signed int)pX <= (signed int)pWindowList[0].uFrameZ |
1549 && (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 ) |
1550 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | 1526 { |
1551 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | 1527 for ( pButton = pWindowList[0].pControlsHead; ; pButton = pButton->pNext ) |
1552 { | 1528 { |
1553 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) | 1529 if ( !pButton ) |
1554 { | 1530 break; |
1555 if ( pButton->uButtonType == 1 ) | 1531 switch ( pButton->uButtonType ) |
1556 { | 1532 { |
1557 if ( (signed int)pX >= (signed int)pButton->uX | 1533 case 1: |
1558 && (signed int)pX <= (signed int)pButton->uZ | 1534 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ |
1559 && (signed int)pY >= (signed int)pButton->uY | 1535 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) |
1560 && (signed int)pY <= (signed int)pButton->uW ) | |
1561 { | |
1562 pMessageType3 = (UIMessageType)pButton->field_1C; | |
1563 if ( pMessageType3 == 0 ) // For books | |
1564 { | 1536 { |
1565 GameUI_SetFooterString(pButton->pButtonName); | 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); | |
1566 uLastPointedObjectID = 1; | 1545 uLastPointedObjectID = 1; |
1567 return; | 1546 return; |
1568 } | 1547 } |
1569 | 1548 break; |
1570 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | 1549 case 2: |
1571 uLastPointedObjectID = 1; | |
1572 return; | |
1573 } | |
1574 } | |
1575 else | |
1576 { | |
1577 if ( pButton->uButtonType == 2 ) | |
1578 { | |
1579 v45 = pX - pButton->uX; | |
1580 v45 = pY - pButton->uY; | |
1581 | |
1582 if (pX >= pButton->uX && pX <= pButton->uZ && | 1550 if (pX >= pButton->uX && pX <= pButton->uZ && |
1583 pY >= pButton->uY && pY <= pButton->uW) | 1551 pY >= pButton->uY && pY <= pButton->uW) |
1584 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
1585 { | 1552 { |
1586 if ( (double)(signed int)pButton->uHeight != 0.0 ) | 1553 pMessageType2 = (UIMessageType)pButton->field_1C; |
1587 { | 1554 if ( pMessageType2 != 0 ) |
1588 //UNDEF(v32); | 1555 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); |
1589 //if ( v33 | v34 ) | 1556 GameUI_SetFooterString(pButton->pButtonName); // for character name |
1590 //{ | 1557 uLastPointedObjectID = 1; |
1591 pMessageType2 = (UIMessageType)pButton->field_1C; | 1558 return; |
1592 if ( pMessageType2 != 0 ) | |
1593 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); | |
1594 | |
1595 GameUI_SetFooterString(pButton->pButtonName); // for character name | |
1596 uLastPointedObjectID = 1; | |
1597 return; | |
1598 //} | |
1599 } | |
1600 } | 1559 } |
1601 } | 1560 break; |
1602 else | 1561 case 3: |
1603 { | 1562 if ( pX >= pButton->uX && pX <= pButton->uZ |
1604 if ( pButton->uButtonType == 3 | |
1605 && pX >= pButton->uX && pX <= pButton->uZ | |
1606 && pY >= pButton->uY && pY <= pButton->uW ) | 1563 && pY >= pButton->uY && pY <= pButton->uW ) |
1607 { | 1564 { |
1608 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | 1565 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; |
1609 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | 1566 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) |
1610 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | 1567 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" |
1612 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | 1569 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" |
1613 GameUI_SetFooterString(Str1); | 1570 GameUI_SetFooterString(Str1); |
1614 uLastPointedObjectID = 1; | 1571 uLastPointedObjectID = 1; |
1615 return; | 1572 return; |
1616 } | 1573 } |
1617 } | 1574 break; |
1618 } | 1575 } |
1619 } | 1576 } |
1620 } | 1577 } |
1621 pMouse->uPointingObjectID = sub_46A99B(); | 1578 pMouse->uPointingObjectID = sub_46A99B(); |
1622 if ( pMouse->uPointingObjectID == 0 ) | 1579 if ( pMouse->uPointingObjectID == 0 ) |