From bb01ab00d4614c5c8a5350dd29229a1a7ae0fa49 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 31 Jul 2024 21:24:14 -0400 Subject: [PATCH 1/2] feat: add copy-to-clipboard for data error We have a button like this for exceptions once you've loaded the project, but we didn't have one for errors that crop up while loading data. Now we do. Closes #146 --- Yafc/Windows/WelcomeScreen.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Yafc/Windows/WelcomeScreen.cs b/Yafc/Windows/WelcomeScreen.cs index fb815834..1b4151dd 100644 --- a/Yafc/Windows/WelcomeScreen.cs +++ b/Yafc/Windows/WelcomeScreen.cs @@ -115,9 +115,14 @@ protected override void BuildContents(ImGui gui) { ShowDropDown(gui, gui.lastRect, ProjectErrorMoreInfo, new Padding(0.5f), 30f); } } - if (gui.BuildButton("Back")) { - errorMessage = null; - Rebuild(); + using (gui.EnterRow()) { + if (gui.BuildButton("Copy to clipboard", SchemeColor.Grey)) { + SDL.SDL_SetClipboardText(errorMessage); + } + if (gui.RemainingRow().BuildButton("Back")) { + errorMessage = null; + Rebuild(); + } } } else { From e6c840aabc75efc93dc3ce792339c25f58255ccc Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 31 Jul 2024 21:24:47 -0400 Subject: [PATCH 2/2] chore: add copy-to-clipboard to changelog --- changelog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.txt b/changelog.txt index dbc95b98..bf0c9cf9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -13,6 +13,8 @@ ---------------------------------------------------------------------------------------------------------------------- Version x.y.z Date: + Features: + - Add "Copy to Clipboard" button for data loading errors Bugfixes: - Fix regression in fluid variant selection when adding recipes. ----------------------------------------------------------------------------------------------------------------------