diff options
Diffstat (limited to 'midend.c')
| -rw-r--r-- | midend.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -81,6 +81,9 @@ struct midend { int pressed_mouse_button; int preferred_tilesize, tilesize, winwidth, winheight; + + void (*game_desc_change_notify_function)(void *); + void *game_desc_change_notify_ctx; }; #define ensure(me) do { \ @@ -1079,12 +1082,20 @@ int midend_wants_statusbar(midend *me) return me->ourgame->wants_statusbar; } +void midend_request_desc_changes(midend *me, void (*notify)(void *), void *ctx) +{ + me->game_desc_change_notify_function = notify; + me->game_desc_change_notify_ctx = ctx; +} + void midend_supersede_game_desc(midend *me, char *desc, char *privdesc) { sfree(me->desc); sfree(me->privdesc); me->desc = dupstr(desc); me->privdesc = privdesc ? dupstr(privdesc) : NULL; + if (me->game_desc_change_notify_function) + me->game_desc_change_notify_function(me->game_desc_change_notify_ctx); } config_item *midend_get_config(midend *me, int which, char **wintitle) |