| 72 | } |
| 73 | |
| 74 | void GuiDecoyCtrl::onMouseUp(const GuiEvent &event) |
| 75 | { |
| 76 | mouseUnlock(); |
| 77 | setUpdate(); |
| 78 | |
| 79 | //this code is pretty hacky. right now there is no way that guiCanvas will allow sending more than |
| 80 | //one signal to one gui control at a time. |
| 81 | if(mIsDecoy == true) |
| 82 | { |
| 83 | mVisible = false; |
| 84 | |
| 85 | GuiControl *parent = getParent(); |
| 86 | Point2I localPoint = parent->globalToLocalCoord(event.mousePoint); |
| 87 | GuiControl *tempControl = parent->findHitControl(localPoint); |
| 88 | |
| 89 | //the decoy control has the responsibility of keeping track of the decoyed controls status |
| 90 | if( mDecoyReference != NULL && tempControl == mDecoyReference) |
| 91 | tempControl->onMouseUp(event); |
| 92 | else if(mDecoyReference != NULL && tempControl != mDecoyReference) |
| 93 | { |
| 94 | //as explained earlier, this control was written in the mindset for buttons. |
| 95 | //nothing bad should ever happen if not a button due to the checks in this function though. |
| 96 | GuiButtonBaseCtrl *unCastCtrl = NULL; |
| 97 | unCastCtrl = dynamic_cast<GuiButtonBaseCtrl *>( mDecoyReference ); |
| 98 | if(unCastCtrl != NULL) |
| 99 | unCastCtrl->resetState(); |
| 100 | } |
| 101 | mVisible = true; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | void GuiDecoyCtrl::onMouseDown(const GuiEvent &event) |
| 106 | { |
nothing calls this directly
no test coverage detected