diff --git a/src/menu.c b/src/menu.c index 6ad2da2..5f4bdfd 100644 --- a/src/menu.c +++ b/src/menu.c @@ -104,13 +104,13 @@ void info_menu(void) { player->ship->name, "Ship", ship_view); window_addButton(wid, -20, (20 + BUTTON_HEIGHT)*3 + 20, BUTTON_WIDTH, BUTTON_HEIGHT, - "btnOutfits", "Outfits", ship_view); + "btnOutfits", "Outfits", NULL); window_addButton(wid, -20, (20 + BUTTON_HEIGHT)*2 + 20, BUTTON_WIDTH, BUTTON_HEIGHT, - "btnCargo", "Cargo", ship_view); + "btnCargo", "Cargo", NULL); window_addButton(wid, -20, 20 + BUTTON_HEIGHT + 20, BUTTON_WIDTH, BUTTON_HEIGHT, - "btnMissions", "Missions", ship_view); + "btnMissions", "Missions", NULL); window_addButton(wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, "btnClose", "Close", info_menu_close); diff --git a/src/toolkit.c b/src/toolkit.c index 0049ef8..ad4750b 100644 --- a/src/toolkit.c +++ b/src/toolkit.c @@ -748,7 +748,13 @@ static void toolkit_mouseEvent(SDL_Event* event) { break; case SDL_MOUSEBUTTONUP: if(wgt->status == WIDGET_STATUS_MOUSEDOWN) { - if(wgt->type == WIDGET_BUTTON) (*wgt->dat.btn.fptr)(wgt->name); + if(wgt->type == WIDGET_BUTTON) { + if(wgt->dat.btn.fptr == NULL) + DEBUG("Toolkit: Button '%s' of Window '%s'" + "Does not have a function trigger", + wgt->name, w->name); + else (*wgt->dat.btn.fptr)(wgt->name); + } } wgt->status = WIDGET_STATUS_NORMAL; break;