Let's start with the easy part, how to enable the mouse cursor. Open the Game Options, then Windows, then the Graphics tab and check this box:
(if you want to draw your own cursor you could draw a sprite at the built-in variables mouse_x, mouse_y - each of the control objects could do this)
Having actual mouse control is considerably more complicated but I think something like this would be the easiest way:
- Edit ggui_menu_handle to comment out all the keyboard controls
- Add a new loop that goes through all frames and does something like this:
if(active){ for(c = 0; c < ggui_frames;c++){ if(mouse_x > ggui_frame_l[c] && mouse_x < ggui_frame_l[c] + ggui_frame_w[ c]){ if(mouse_y > ggui_frame_t[c] && mouse_x < ggui_frame_t[c] + ggui_frame_h[ c]){ //We're in this frame, select it for(var d = 0; d < menu_w; d++){ for(var e = 0; e < menu_h; e++){ if(menu_frame[d,e] == c){ menuvalue_x = d; menuvalue_y = e; if(mouse_check_button_pressed(mb_left)){ //Clicked something! Run the regular "A button" code if(menu_event[menuvalue_x,menuvalue_y] != NONE){ sfx(snd_menu_ok) script_execute(menu_event[menuvalue_x,menuvalue_y]) } else{ sfx(snd_menu_buzzer) } } break; //End when we find the first frame that matches } } } } } } }
Now this will remove the "cancel button" option you had before but you could solve that by adding a "X" button in the top right corner. (You still need to preallocate enough menu options for all buttons but since the player needs to physically hover them you could put any "padding" buttons offscreen if you need to allocate more buttons than you'd physically use)
(actually maybe it would be easier to handle the X button out of GGUI entirely - just draw a "close" button at the top-right of every menu frame and check if you're in the top right 16x16 pixels of the menu in the Mouse Left Released event, if so destroy the instance and don't even check for frames)
There's more stuff you could do here, like playing the "menu move" sound when you detect that you changed either menuvalue_x or menuvalue_y, but this should be a good starting point.