Skip to content

Commit

Permalink
Renderer: display popover to warn when colors are synced.
Browse files Browse the repository at this point in the history
This should help clarify this specific state (see #84).
  • Loading branch information
kosua20 committed Dec 10, 2020
1 parent 43eec32 commit 36c603d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/rendering/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,11 @@ void Renderer::synchronizeColors(const ColorArray & colors){
_state.baseColors[cid] = _state.particles.colors[cid] = _state.minorColors[cid] = _state.flashColors[cid] = colors[cid];
}

// If we have only one channel, synchronize one-shoft effects.
if(!_state.perChannelColors){
_state.pedals.color = _state.waves.color = _state.baseColors[0];
}
// If we have only one channel, synchronize one-shot effects.
// Disable this because it's not symmetric.
//if(!_state.perChannelColors){
// _state.pedals.color = _state.waves.color = _state.baseColors[0];
//}
}

SystemAction Renderer::showTopButtons(double currentTime){
Expand Down Expand Up @@ -1275,6 +1276,11 @@ bool Renderer::channelColorEdit(const char * name, const char * displayName, Col
ImGuiPushItemWidth(25);
const bool inter = ImGui::ColorEdit3(name, &colors[0][0], ImGuiColorEditFlags_NoInputs);
ImGui::PopItemWidth();

if(_state.lockParticleColor && ImGui::IsItemHovered()){
ImGui::SetTooltip("(!) Effect colors\n are synced");
}

if(inter){
// Ensure synchronization.
for(size_t cid = 1; cid < colors.size(); ++cid){
Expand Down
2 changes: 1 addition & 1 deletion src/rendering/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <array>

#define MIDIVIZ_VERSION_MAJOR 6
#define MIDIVIZ_VERSION_MINOR 0
#define MIDIVIZ_VERSION_MINOR 1

#define COLUMN_SIZE 170
#define EXPORT_COLUMN_SIZE 200
Expand Down

0 comments on commit 36c603d

Please sign in to comment.