| 429 | } |
| 430 | |
| 431 | void QuickSpawnMenu::DrawModule() |
| 432 | { |
| 433 | ofPushStyle(); |
| 434 | |
| 435 | mHighlightIndex = -1; |
| 436 | if (TheSynth->GetMouseY(GetOwningContainer()) > GetPosition().y) |
| 437 | mHighlightIndex = GetIndexAt(TheSynth->GetMouseX(GetOwningContainer()) - GetPosition().x, TheSynth->GetMouseY(GetOwningContainer()) - GetPosition().y); |
| 438 | |
| 439 | ofSetColor(50, 50, 50, 100); |
| 440 | ofFill(); |
| 441 | ofRect(-2, -2, mWidth + 4, mHeight + 4); |
| 442 | for (int i = 0; i < mElements.size(); ++i) |
| 443 | { |
| 444 | if (mMenuMode == MenuMode::ModuleCategories) |
| 445 | ofSetColor(IDrawableModule::GetColor(TheTitleBar->GetSpawnLists()[mCategoryIndices[i]]->GetCategory()) * (i == mHighlightIndex ? .7f : .5f), 255); |
| 446 | else |
| 447 | ofSetColor(IDrawableModule::GetColor(TheSynth->GetModuleFactory()->GetModuleCategory(mElements[i])) * (i == mHighlightIndex ? .7f : .5f), 255); |
| 448 | ofRect(0, i * kItemSpacing + 1, mWidth, kItemSpacing - 1); |
| 449 | if (i == mHighlightIndex) |
| 450 | ofSetColor(255, 255, 0); |
| 451 | else |
| 452 | ofSetColor(255, 255, 255); |
| 453 | |
| 454 | bool showDecorator = true; |
| 455 | if (mMenuMode == MenuMode::SingleCategory && mSelectedCategoryIndex >= 0 && mSelectedCategoryIndex < (int)TheTitleBar->GetSpawnLists().size()) |
| 456 | showDecorator = TheTitleBar->GetSpawnLists()[mSelectedCategoryIndex]->ShouldShowDecorators(); |
| 457 | |
| 458 | DrawTextNormal(mElements[i].mLabel + (showDecorator ? (" " + mElements[i].mDecorator) : ""), 1 + (mMenuMode == MenuMode::SingleLetter ? 0 : kRightClickShiftX), i * kItemSpacing + 12); |
| 459 | } |
| 460 | if (mElements.size() == 0) |
| 461 | { |
| 462 | ofSetColor(255, 255, 255); |
| 463 | DrawTextNormal("no modules found", 1, 12); |
| 464 | } |
| 465 | |
| 466 | ofPopStyle(); |
| 467 | |
| 468 | mMainContainerFollower->UpdateLocation(); |
| 469 | } |
| 470 | |
| 471 | void QuickSpawnMenu::DrawModuleUnclipped() |
| 472 | { |
nothing calls this directly
no test coverage detected