Skip to content

Commit c54cb93

Browse files
committed
Add dialog support to GUI plugin.
1 parent 46a5d82 commit c54cb93

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugins/gui/gui.c

+11
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,16 @@ ctr_object* ctr_network_basic_text_send(ctr_object* myself, ctr_argument* argume
646646
extern ctr_object* ctr_network_basic_text_send(ctr_object* myself, ctr_argument* argumentList);
647647
#endif
648648

649+
650+
ctr_object* ctr_gui_dialog(ctr_object* myself, ctr_argument* argumentList) {
651+
char* message = ctr_heap_allocate_cstring(
652+
ctr_internal_cast2string(argumentList->object)
653+
);
654+
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Message", message, NULL);
655+
ctr_heap_free(message);
656+
return myself;
657+
}
658+
649659
void begin() {
650660
ctr_internal_gui_init();
651661
colorObject = ctr_color_new(CtrStdObject, NULL);
@@ -686,6 +696,7 @@ void begin() {
686696
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_WIDTH_HEIGHT_SET ), &ctr_gui_width_height_set );
687697
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_LINK_SET ), &ctr_gui_link_package );
688698
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_SCREEN ), &ctr_gui_screen );
699+
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_DIALOG_SET ), &ctr_gui_dialog );
689700
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( "use:" ), &ctr_gui_include );
690701
if (strcmp(CTR_DICT_USE_SET,"use:")!=0) {
691702
ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_USE_SET ), &ctr_gui_include );

0 commit comments

Comments
 (0)