From 5e2743d9b8eb645b998af972f223876717e6d210 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Mon, 1 Jul 2013 12:10:12 +0200 Subject: [PATCH] No color picking while playing Change so color picking can't be used during playback as this causes some issues. Would be nice to support it but at least this doesn't screw everything up. Closes #76 --- ogl_editor/src/Editor.c | 2 ++ ogl_editor/src/TrackData.h | 1 + ogl_editor/src/TrackView.c | 9 ++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ogl_editor/src/Editor.c b/ogl_editor/src/Editor.c index 62d71f9..10687cf 100644 --- a/ogl_editor/src/Editor.c +++ b/ogl_editor/src/Editor.c @@ -278,6 +278,7 @@ void Editor_create() s_editorData.trackData.startRow = 0; s_editorData.trackData.endRow = 10000; s_editorData.trackData.highlightRowStep = 8; + s_editorData.trackData.isPlaying = false; Emgui_setDefaultFont(); } @@ -1182,6 +1183,7 @@ static void onEnterCurrentValue() static void onPlay() { RemoteConnection_sendPauseCommand(!RemoteConnection_isPaused()); + getTrackData()->isPlaying = !RemoteConnection_isPaused(); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ogl_editor/src/TrackData.h b/ogl_editor/src/TrackData.h index 2035f63..272ad66 100644 --- a/ogl_editor/src/TrackData.h +++ b/ogl_editor/src/TrackData.h @@ -73,6 +73,7 @@ typedef struct TrackData int endRow; int highlightRowStep; char* editText; + bool isPlaying; } TrackData; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ogl_editor/src/TrackView.c b/ogl_editor/src/TrackView.c index 8e69e85..03c849b 100644 --- a/ogl_editor/src/TrackView.c +++ b/ogl_editor/src/TrackView.c @@ -342,10 +342,13 @@ static int renderChannel(struct TrackInfo* info, int startX, Track* trackData, b { if (drawColorButton(color, startX + 4, info->startY - colorbar_adjust, size)) { - Dialog_showColorPicker(&trackData->color); + if (!info->trackData->isPlaying) + { + Dialog_showColorPicker(&trackData->color); - if (trackData->color != color) - s_needsUpdate = true; + if (trackData->color != color) + s_needsUpdate = true; + } } } else