| 870 | } |
| 871 | |
| 872 | void ModularSynth::DrawConsole() |
| 873 | { |
| 874 | /*if (!mErrors.empty()) |
| 875 | { |
| 876 | ofPushStyle(); |
| 877 | ofFill(); |
| 878 | ofSetColor(255,0,0,128); |
| 879 | ofBeginShape(); |
| 880 | ofVertex(0,0); |
| 881 | ofVertex(20,0); |
| 882 | ofVertex(0,20); |
| 883 | ofEndShape(); |
| 884 | ofPopStyle(); |
| 885 | }*/ |
| 886 | |
| 887 | float consoleY = TheTitleBar->GetRect().height + 15; |
| 888 | |
| 889 | if (IKeyboardFocusListener::GetActiveKeyboardFocus() == mConsoleEntry) |
| 890 | { |
| 891 | mConsoleEntry->SetPosition(0, consoleY - 15); |
| 892 | mConsoleEntry->Draw(); |
| 893 | consoleY += 17; |
| 894 | } |
| 895 | else |
| 896 | { |
| 897 | if (gHoveredUIControl != nullptr) |
| 898 | { |
| 899 | ofPushStyle(); |
| 900 | ofSetColor(0, 255, 255); |
| 901 | DrawTextNormal(gHoveredUIControl->Path(), 0, consoleY - 4); |
| 902 | ofPopStyle(); |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | if (mHasCircularDependency) |
| 907 | { |
| 908 | ofPushStyle(); |
| 909 | float pulse = ofMap(sin(gTime / 500 * PI * 2), -1, 1, .5f, 1); |
| 910 | ofSetColor(255 * pulse, 255 * pulse, 0); |
| 911 | DrawTextNormal("circular dependency detected", 0, consoleY + 20); |
| 912 | ofPopStyle(); |
| 913 | } |
| 914 | |
| 915 | if (IKeyboardFocusListener::GetActiveKeyboardFocus() == mConsoleEntry) |
| 916 | { |
| 917 | int outputLines = (int)mEvents.size(); |
| 918 | if (IKeyboardFocusListener::GetActiveKeyboardFocus() == mConsoleEntry) |
| 919 | outputLines += mErrors.size(); |
| 920 | if (outputLines > 0) |
| 921 | { |
| 922 | ofPushStyle(); |
| 923 | ofSetColor(0, 0, 0, 150); |
| 924 | ofFill(); |
| 925 | float titleBarW, titleBarH; |
| 926 | TheTitleBar->GetDimensions(titleBarW, titleBarH); |
| 927 | ofRect(0, consoleY - 16, titleBarW, outputLines * 15 + 3); |
| 928 | ofPopStyle(); |
| 929 | } |
nothing calls this directly
no test coverage detected