Add show_error function - #399
Conversation
* replace random with well512a * fix * fix * bakc * fix
* add call_later and call_cancel * for wad17 or higher * fix type conversions for ps2 * omg why is it so picky * #if IS_WAD17_OR_HIGHER_ENABLED for builtin_call_later * use a valid currentInstance context for callback execution
* add tile_layer_delete_at * tile_layer_depth (I don't know if it works properly)
* arctan2 * dot_product_3d * dot_product_(3d_)normalised * draw_arrow * calculate arrowhead before drawing line * ln * log10 * logn * max3 * min3
fixes `GL_INVALID_OPERATION in glUniform1(rippleBanding@7 is int, not float)` in ch5
…tterscotchRunner#393) * Improved memory, fixed shaders and fixed shoulder buttons * Directly upload VBO data for the vita * Delete .al_audio_system.c.kate-swp * Change memory sizes around * GL renderer optimizations for vita * Nuke glClear calls for Vita
This reverts commit 876ab69.
* macos test runner * add x86_64 runner * Fix uniq's reviews * Fix typo * Use AppKit * chore(ci): matrix builds for macos * chore(ci): macos glfw->appkit * ccache * remove deprecation warnings * remove commit date/hash from cmake * speed up homebrew? --------- Co-authored-by: Fancy2209 <64917206+Fancy2209@users.noreply.github.com> Co-authored-by: cobaltgit <cobaltsecuremail312@proton.me>
…ms (ButterscotchRunner#406) * use glGetUniformLocation instead of looping through the shader uniforms * make it a little nicer * oopsies pointers
* chore(ci): use ninja for CI where possible to speed up builds * fix(ci): install ninja in ps2dev container * do the same for the tests * ccache?? * fix(ci): use GNU tar in alpine containers * chore(ci): speed-up Windows x86 build * fix * restore keys * try use ccache for vitagl build * trigger ci * ccache for android? * forgor * trigger ci to test android * remove ignore opts for all except ps2
* chore(ci): add ARM64 FreeBSD build * aarch64 * why did they make the sysroot arch name different from the pkg arch name
| -DWERROR=ON \ | ||
| -DDESKTOP_BACKEND=glfw3 \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_C_FLAGS="-Wno-error=unused-but-set-global" \ |
There was a problem hiding this comment.
there was some issue with an unused variable in glad
|
I think including gtk and qt isn't worth it and we should just use nuklear or some other solution that doesn't require platform specific apis or new big dependencies. |
|
I've removed qt6 now and GTK3 is an optional dependency that only adds it if it detects that it's installed. There's still a fallback to just print to the console. If you want minimal dependencies then I think my fallback that uses GameMaker functions to draw the error message would be better than nuklear as we can 100% guarantee it'll work on any platform that Butterscotch works on. |
Can we just use that everywhere (even on windows and mac), I think it looks better then messageboxes anyway. |
|
I mean I guess but I haven’t figured out how to properly do that yet, currently it’s just the ugly solution of pausing everything and forcing it to the screen. I think the messages boxes feel more native and are what a user would expect. |
Adds support for
show_error(message: String, abort: bool).Implementation
The function takes two arguments. The first, the error message, is sent to
runner->showErrorDialogueif it exists. A check is made before it's called, as showErrorDialogue is not implemented for all platforms. If the abort bool is true, it setsrunner->shouldExitto true.Regardless of what happens, the function also fprintf's the error to the console log.
Windows, macOS and Linux
Error messages must be implemented per platform. I've created a directory
src/desktop/platform/with files forwindows.c,macos.mandgtk3.c.MessageBoxA.macOS 26.5.1, native NSAlert
KDE Plasma VM, GTK3
Why not SDL2/3 SDL_ShowSimpleMessageBox?
First of all it looks.. really ugly. And @Un1q32 says that some older versions can segfault really easily. Also I think that targeting GTK3, Windows and macOS should cover >99% of desktop users.
PS Vita
SceMsgDialogParam is used to show an error message.
Android, Web, PS2 and PS3
Android and PS3 have native error dialogues that could be implemented. For all other devices, I'd like to implement a fallback with something like this.
While it's not pretty yet, it uses gamemaker builtin functions to draw to the screen, so we can guarantee that it'll be compatible with all platforms that butterscotch targets.