| 2461 | } |
| 2462 | |
| 2463 | void GameConnection::setSelectedObj(SceneObject* so, bool propagate_to_client) |
| 2464 | { |
| 2465 | if (!isConnectionToServer()) |
| 2466 | { |
| 2467 | // clear previously selected object |
| 2468 | if (mSelectedObj) |
| 2469 | clearNotify(mSelectedObj); |
| 2470 | |
| 2471 | // save new selection |
| 2472 | mSelectedObj = so; |
| 2473 | |
| 2474 | // mark selected object |
| 2475 | if (mSelectedObj) |
| 2476 | deleteNotify(mSelectedObj); |
| 2477 | |
| 2478 | // mark selection dirty |
| 2479 | if (propagate_to_client) |
| 2480 | mChangedSelectedObj = true; |
| 2481 | |
| 2482 | return; |
| 2483 | } |
| 2484 | |
| 2485 | // clear previously selected object |
| 2486 | if (mSelectedObj) |
| 2487 | { |
| 2488 | mSelectedObj->setSelectionFlags(mSelectedObj->getSelectionFlags() & ~SceneObject::SELECTED); |
| 2489 | clearNotify(mSelectedObj); |
| 2490 | Con::executef(this, "onObjectDeselected", mSelectedObj->getIdString()); |
| 2491 | } |
| 2492 | |
| 2493 | // save new selection |
| 2494 | mSelectedObj = so; |
| 2495 | |
| 2496 | // mark selected object |
| 2497 | if (mSelectedObj) |
| 2498 | { |
| 2499 | mSelectedObj->setSelectionFlags(mSelectedObj->getSelectionFlags() | SceneObject::SELECTED); |
| 2500 | deleteNotify(mSelectedObj); |
| 2501 | } |
| 2502 | |
| 2503 | // mark selection dirty |
| 2504 | //mChangedSelectedObj = true; |
| 2505 | |
| 2506 | // notify appropriate script of the change |
| 2507 | if (mSelectedObj) |
| 2508 | Con::executef(this, "onObjectSelected", mSelectedObj->getIdString()); |
| 2509 | } |
| 2510 | |
| 2511 | void GameConnection::setRolloverObj(SceneObject* so) |
| 2512 | { |
no test coverage detected