comparison UI/UiGame.cpp @ 2020:b123afb8246b

WritePointedObjectStatusString() clear
author Ritor1
date Mon, 11 Nov 2013 22:03:16 +0600
parents ab7d10b66503
children b60eaf28bf0c
comparison
equal deleted inserted replaced
2019:ab7d10b66503 2020:b123afb8246b
1493 } 1493 }
1494 } 1494 }
1495 } 1495 }
1496 } 1496 }
1497 }//конец пределов основного экрана------------------------ 1497 }//конец пределов основного экрана------------------------
1498 if ( pX > 467 && pX <=639 && pY <= 479 )//пределы нижней области 1498 if ( pX > 467 && pX <=639 && pY <= 479 )//пределы правой области
1499 { 1499 {
1500 if ( pCurrentScreen == SCREEN_GAME ) 1500 if ( pCurrentScreen == SCREEN_GAME )
1501 {
1501 pWindow = &pWindowList[0]; 1502 pWindow = &pWindowList[0];
1503 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ
1504 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW )
1505 {
1506 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
1507 {
1508 if ( !pButton )
1509 break;
1510 switch ( pButton->uButtonType )
1511 {
1512 case 1://for dialogue window
1513 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ
1514 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW )
1515 {
1516 pMessageType1 = (UIMessageType)pButton->field_1C;
1517 if ( pMessageType1 )
1518 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1519 GameUI_SetFooterString(pButton->pButtonName);
1520 uLastPointedObjectID = 1;
1521 return;
1522 }
1523 break;
1524 case 2:
1525 if ( pX >= pButton->uX && pX <= pButton->uZ
1526 && pY >= pButton->uY && pY <= pButton->uW )
1527 {
1528 pMessageType1 = (UIMessageType)pButton->field_1C;
1529 if ( pMessageType1 )
1530 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1531 GameUI_SetFooterString(pButton->pButtonName);
1532 uLastPointedObjectID = 1;
1533 return;
1534 }
1535 break;
1536 case 3:// click on skill
1537 if ( pX >= pButton->uX && pX <= pButton->uZ
1538 && pY >= pButton->uY && pY <= pButton->uW )
1539 {
1540 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
1541 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
1542 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
1543 else
1544 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
1545 GameUI_SetFooterString(Str1);
1546 uLastPointedObjectID = 1;
1547 return;
1548 }
1549 break;
1550 }
1551 }
1552 }
1553 }
1502 else 1554 else
1503 pWindow = &pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 1]; 1555 {
1556 for ( v1 = uNumVisibleWindows; v1 > 0; --v1 )
1557 {
1558 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1];
1559 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ
1560 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW )
1561 {
1562 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
1563 {
1564 if ( !pButton )
1565 break;
1566 switch ( pButton->uButtonType )
1567 {
1568 case 1://for dialogue window
1569 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ
1570 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW )
1571 {
1572 pMessageType1 = (UIMessageType)pButton->field_1C;
1573 if ( pMessageType1 )
1574 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1575 GameUI_SetFooterString(pButton->pButtonName);
1576 uLastPointedObjectID = 1;
1577 return;
1578 }
1579 break;
1580 case 2:
1581 if ( pX >= pButton->uX && pX <= pButton->uZ
1582 && pY >= pButton->uY && pY <= pButton->uW )
1583 {
1584 pMessageType1 = (UIMessageType)pButton->field_1C;
1585 if ( pMessageType1 )
1586 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1587 GameUI_SetFooterString(pButton->pButtonName);
1588 uLastPointedObjectID = 1;
1589 return;
1590 }
1591 break;
1592 case 3:// click on skill
1593 if ( pX >= pButton->uX && pX <= pButton->uZ
1594 && pY >= pButton->uY && pY <= pButton->uW )
1595 {
1596 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
1597 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
1598 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
1599 else
1600 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
1601 GameUI_SetFooterString(Str1);
1602 uLastPointedObjectID = 1;
1603 return;
1604 }
1605 break;
1606 }
1607 }
1608 }
1609 }
1610 }
1611 }
1612 if ( pX <= 467 && pY > 351 && pY <= 479 )//пределы нижней области
1613 {
1614 pWindow = &pWindowList[0];
1504 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ 1615 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ
1505 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) 1616 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW )
1506 { 1617 {
1507 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) 1618 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
1508 { 1619 {
1549 } 1660 }
1550 break; 1661 break;
1551 } 1662 }
1552 } 1663 }
1553 } 1664 }
1554 //} 1665 }
1555 } 1666 //pMouse->uPointingObjectID = sub_46A99B(); //for software
1556 if ( pX <= 467 && pY > 351 && pY <= 479 )//пределы нижней области
1557 {
1558 //for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui
1559 //{
1560 pWindow = &pWindowList[0];
1561 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ
1562 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW )
1563 {
1564 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
1565 {
1566 if ( !pButton )
1567 break;
1568 switch ( pButton->uButtonType )
1569 {
1570 case 1://for dialogue window
1571 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ
1572 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW )
1573 {
1574 pMessageType1 = (UIMessageType)pButton->field_1C;
1575 if ( pMessageType1 )
1576 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1577 GameUI_SetFooterString(pButton->pButtonName);
1578 uLastPointedObjectID = 1;
1579 return;
1580 }
1581 break;
1582 case 2:
1583 if ( pX >= pButton->uX && pX <= pButton->uZ
1584 && pY >= pButton->uY && pY <= pButton->uW )
1585 {
1586 pMessageType1 = (UIMessageType)pButton->field_1C;
1587 if ( pMessageType1 )
1588 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0);
1589 GameUI_SetFooterString(pButton->pButtonName);
1590 uLastPointedObjectID = 1;
1591 return;
1592 }
1593 break;
1594 case 3:// click on skill
1595 if ( pX >= pButton->uX && pX <= pButton->uZ
1596 && pY >= pButton->uY && pY <= pButton->uW )
1597 {
1598 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
1599 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 )
1600 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
1601 else
1602 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points"
1603 GameUI_SetFooterString(Str1);
1604 uLastPointedObjectID = 1;
1605 return;
1606 }
1607 break;
1608 }
1609 }
1610 }
1611 //}
1612 }
1613 //pMouse->uPointingObjectID = sub_46A99B();
1614 if ( pMouse->uPointingObjectID == 0 ) 1667 if ( pMouse->uPointingObjectID == 0 )
1615 { 1668 {
1616 if ( uLastPointedObjectID != 0 ) 1669 if ( uLastPointedObjectID != 0 )
1617 { 1670 {
1618 pFooterString[0] = 0; 1671 pFooterString[0] = 0;