| 378 | } |
| 379 | |
| 380 | List<Drawable> Player::drawables() const { |
| 381 | List<Drawable> drawables; |
| 382 | |
| 383 | if (!isTeleporting()) { |
| 384 | drawables.appendAll(m_techController->backDrawables()); |
| 385 | if (!m_techController->parentHidden()) { |
| 386 | m_tools->setupHumanoidHandItemDrawables(*m_humanoid); |
| 387 | |
| 388 | // Auto-detect any ?scalenearest and apply them as a direct scale on the Humanoid's drawables instead. |
| 389 | DirectivesGroup humanoidDirectives; |
| 390 | Vec2F scale = Vec2F::filled(1.f); |
| 391 | auto extractScale = [&](List<Directives> const& list) { |
| 392 | for (auto& directives : list) { |
| 393 | auto result = Humanoid::extractScaleFromDirectives(directives); |
| 394 | scale = scale.piecewiseMultiply(result.first); |
| 395 | humanoidDirectives.append(result.second); |
| 396 | } |
| 397 | }; |
| 398 | extractScale(m_techController->parentDirectives().list()); |
| 399 | extractScale(m_statusController->parentDirectives().list()); |
| 400 | m_humanoid->setScale(scale); |
| 401 | |
| 402 | for (auto& drawable : m_humanoid->render()) { |
| 403 | drawable.translate(position() + m_techController->parentOffset()); |
| 404 | if (drawable.isImage()) { |
| 405 | drawable.imagePart().addDirectivesGroup(humanoidDirectives, true); |
| 406 | |
| 407 | if (auto anchor = as<LoungeAnchor>(m_movementController->entityAnchor())) { |
| 408 | if (auto& directives = anchor->directives) |
| 409 | drawable.imagePart().addDirectives(*directives, true); |
| 410 | } |
| 411 | } |
| 412 | drawables.append(std::move(drawable)); |
| 413 | } |
| 414 | } |
| 415 | drawables.appendAll(m_techController->frontDrawables()); |
| 416 | |
| 417 | drawables.appendAll(m_statusController->drawables()); |
| 418 | |
| 419 | drawables.appendAll(m_tools->renderObjectPreviews(aimPosition(), walkingDirection(), inToolRange(), favoriteColor())); |
| 420 | } |
| 421 | |
| 422 | drawables.appendAll(m_effectsAnimator->drawables(position())); |
| 423 | |
| 424 | return drawables; |
| 425 | } |
| 426 | |
| 427 | List<OverheadBar> Player::bars() const { |
| 428 | return m_statusController->overheadBars(); |
no test coverage detected