Bug #1630 » 1630_gtk4.patch
client/gui-gtk-4.0/menu.c | ||
---|---|---|
static void leave_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data);
|
||
static void volume_up_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data);
|
||
static void volume_down_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data);
|
||
static void quit_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data);
|
||
... | ... | |
{ "LEAVE", N_("_Leave"),
|
||
"leave", NULL, MGROUP_SAFE,
|
||
NULL, FALSE },
|
||
{ "VOLUME_UP", N_("_Volume Up"),
|
||
"volume_up", "greater", MGROUP_SAFE,
|
||
NULL, FALSE },
|
||
{ "VOLUME_DOWN", N_("_Volume Down"),
|
||
"volume_down", "less", MGROUP_SAFE,
|
||
NULL, FALSE },
|
||
{ "QUIT", N_("_Quit"),
|
||
"quit", ACCL_MOD_KEY"q", MGROUP_SAFE,
|
||
NULL, FALSE },
|
||
... | ... | |
{ "save_mapimg", save_mapimg_callback },
|
||
{ "save_mapimg_as", save_mapimg_as_callback },
|
||
{ "leave", leave_callback },
|
||
{ "volume_up", volume_up_callback },
|
||
{ "volume_down", volume_down_callback },
|
||
{ "quit", quit_callback },
|
||
{ "find_city", find_city_callback },
|
||
... | ... | |
}
|
||
}
|
||
/************************************************************************//**
|
||
Item "VOLUME_UP" callback.
|
||
****************************************************************************/
|
||
static void volume_up_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data)
|
||
{
|
||
struct option *poption = optset_option_by_name(client_optset, "sound_effects_volume");
|
||
gui_options.sound_effects_volume += 10;
|
||
gui_options.sound_effects_volume = CLIP(0, gui_options.sound_effects_volume, 100);
|
||
option_changed(poption);
|
||
}
|
||
/************************************************************************//**
|
||
Item "VOLUME_DOWN" callback.
|
||
****************************************************************************/
|
||
static void volume_down_callback(GSimpleAction *action,
|
||
GVariant *parameter,
|
||
gpointer data)
|
||
{
|
||
struct option *poption = optset_option_by_name(client_optset, "sound_effects_volume");
|
||
gui_options.sound_effects_volume -= 10;
|
||
gui_options.sound_effects_volume = CLIP(0, gui_options.sound_effects_volume, 100);
|
||
option_changed(poption);
|
||
}
|
||
/************************************************************************//**
|
||
Item "QUIT" callback.
|
||
****************************************************************************/
|
||
... | ... | |
menu_entry_init(topmenu, "MAPIMG_SAVE");
|
||
menu_entry_init(topmenu, "MAPIMG_SAVE_AS");
|
||
menu_entry_init(topmenu, "LEAVE");
|
||
menu_entry_init(topmenu, "VOLUME_UP");
|
||
menu_entry_init(topmenu, "VOLUME_DOWN");
|
||
menu_entry_init(topmenu, "QUIT");
|
||
submenu_append_unref(menubar, _("_Game"), G_MENU_MODEL(topmenu));
|