| 508 | } |
| 509 | |
| 510 | int CUi::DoButtonLogic(const void *pId, int Checked, const CUIRect *pRect, const unsigned Flags) |
| 511 | { |
| 512 | int ReturnValue = 0; |
| 513 | const bool Inside = MouseHovered(pRect); |
| 514 | |
| 515 | if(CheckActiveItem(pId)) |
| 516 | { |
| 517 | dbg_assert(m_ActiveButtonLogicButton >= 0, "m_ActiveButtonLogicButton invalid"); |
| 518 | if(!MouseButton(m_ActiveButtonLogicButton)) |
| 519 | { |
| 520 | if(Inside && Checked >= 0) |
| 521 | ReturnValue = 1 + m_ActiveButtonLogicButton; |
| 522 | SetActiveItem(nullptr); |
| 523 | m_ActiveButtonLogicButton = -1; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | bool NoRelevantButtonsPressed = true; |
| 528 | for(int Button = 0; Button < 3; ++Button) |
| 529 | { |
| 530 | if((Flags & (BUTTONFLAG_LEFT << Button)) && MouseButton(Button)) |
| 531 | { |
| 532 | NoRelevantButtonsPressed = false; |
| 533 | if(HotItem() == pId) |
| 534 | { |
| 535 | SetActiveItem(pId); |
| 536 | m_ActiveButtonLogicButton = Button; |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | |
| 541 | if(Inside && NoRelevantButtonsPressed) |
| 542 | SetHotItem(pId); |
| 543 | |
| 544 | return ReturnValue; |
| 545 | } |
| 546 | |
| 547 | int CUi::DoDraggableButtonLogic(const void *pId, int Checked, const CUIRect *pRect, bool *pClicked, bool *pAbrupted) |
| 548 | { |
no outgoing calls
no test coverage detected