From 8a2ae6860e2fa0c4fc43cfbec091a43ee07cacf6 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 28 Aug 2021 18:32:26 -0400 Subject: [PATCH] [client] egl: warn when attempting to save without preset selected --- client/renderers/EGL/postprocess.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/renderers/EGL/postprocess.c b/client/renderers/EGL/postprocess.c index ea34455b..c939f3f5 100644 --- a/client/renderers/EGL/postprocess.c +++ b/client/renderers/EGL/postprocess.c @@ -339,8 +339,13 @@ static bool presetsUI(struct EGL_PostProcess * this) igSameLine(0.0f, -1.0f); - if (igButton("Save preset", (ImVec2) { 0.0f, 0.0f }) && this->activePreset >= 0) - savePreset(this, stringlist_at(this->presets, this->activePreset)); + if (igButton("Save preset", (ImVec2) { 0.0f, 0.0f })) + { + if (this->activePreset >= 0) + savePreset(this, stringlist_at(this->presets, this->activePreset)); + else + presetError(this, strdup("You must select a preset to save.")); + } if (igIsItemHovered(ImGuiHoveredFlags_None) && this->activePreset >= 0) igSetTooltip("This will overwrite the preset named: %s",