| 1293 | } |
| 1294 | |
| 1295 | void MapEditor::UpdateCursor(const LineSegment& mouseray, GameCursor* cursor) { |
| 1296 | Collision mouseray_collision_selected = |
| 1297 | lineCheckActiveSelected(scenegraph_, mouseray.start, mouseray.end, NULL, NULL); |
| 1298 | EditorTypes::Tool tool_cursor; |
| 1299 | switch (active_tool_) { |
| 1300 | case EditorTypes::OMNI: |
| 1301 | tool_cursor = omni_tool_tool_; |
| 1302 | break; |
| 1303 | case EditorTypes::CONNECT: |
| 1304 | tool_cursor = EditorTypes::CONNECT; |
| 1305 | break; |
| 1306 | case EditorTypes::DISCONNECT: |
| 1307 | tool_cursor = EditorTypes::DISCONNECT; |
| 1308 | break; |
| 1309 | case EditorTypes::ADD_ONCE: |
| 1310 | tool_cursor = EditorTypes::ADD_ONCE; |
| 1311 | break; |
| 1312 | default: |
| 1313 | if (mouseray_collision_selected.hit) { |
| 1314 | tool_cursor = active_tool_; |
| 1315 | } else { |
| 1316 | if (!sky_editor_->m_sun_translating && !sky_editor_->m_sun_scaling && !sky_editor_->m_sun_rotating) { |
| 1317 | sky_editor_->UpdateCursor(cursor); |
| 1318 | } |
| 1319 | return; |
| 1320 | // tool_cursor = EditorTypes::NO_TOOL; |
| 1321 | } |
| 1322 | } |
| 1323 | switch (tool_cursor) { |
| 1324 | case EditorTypes::CONNECT: |
| 1325 | cursor->SetCursor(LINK_CURSOR); |
| 1326 | break; |
| 1327 | case EditorTypes::DISCONNECT: |
| 1328 | cursor->SetCursor(UNLINK_CURSOR); |
| 1329 | break; |
| 1330 | case EditorTypes::TRANSLATE: |
| 1331 | cursor->SetCursor(TRANSLATE_CURSOR); |
| 1332 | break; |
| 1333 | case EditorTypes::SCALE: |
| 1334 | cursor->SetCursor(SCALE_CURSOR); |
| 1335 | break; |
| 1336 | case EditorTypes::ROTATE: |
| 1337 | cursor->SetCursor(ROTATE_CURSOR); |
| 1338 | break; |
| 1339 | case EditorTypes::ADD_ONCE: |
| 1340 | cursor->SetCursor(ADD_CURSOR); |
| 1341 | break; |
| 1342 | default: |
| 1343 | cursor->SetCursor(DEFAULT_CURSOR); |
| 1344 | break; |
| 1345 | } |
| 1346 | } |
| 1347 | |
| 1348 | void MapEditor::CopySelected() { |
| 1349 | RibbonFlash(gui, "copy"); |
nothing calls this directly
no test coverage detected