The Battle for Wesnoth  1.17.0-dev
mp_ui_alerts.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2021
3  by Chris Beck <render787@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 /**
17  * This namespace provides handlers which play the sounds / notificaitons
18  * for various mp server events, depending on the preference configuration.
19  */
20 
21 #pragma once
22 
23 #include<string>
24 #include<vector>
25 
26 namespace mp_ui_alerts {
27 
28  // Functions called when such an event occurs
29  void player_joins(bool is_lobby);
30  void player_leaves(bool is_lobby);
31  void game_created(const std::string & scenario, const std::string & name);
32  void public_message(bool is_lobby, const std::string & sender, const std::string & message);
33  void friend_message(bool is_lobby, const std::string & sender, const std::string & message);
34  void private_message(bool is_lobby, const std::string & sender, const std::string & message);
35  void server_message(bool is_lobby, const std::string & sender, const std::string & message);
36  void ready_for_start();
37  void game_has_begun();
38 
39  void turn_changed(const std::string & player);
40 
41  // Functions to calculate what the default preference should be
42  bool get_def_pref_sound(const std::string &);
43  bool get_def_pref_notif(const std::string &);
44  bool get_def_pref_lobby(const std::string &);
45 
46  // Note, this list of items must match those ids defined in data/gui/dialogs/mp_alerts_options.cfg
47  extern const std::vector<std::string> items;
48 }
void ready_for_start()
void turn_changed(const std::string &player_name)
void game_has_begun()
This namespace provides handlers which play the sounds / notificaitons for various mp server events...
const std::vector< std::string > items
void friend_message(bool is_lobby, const std::string &sender, const std::string &message)
void private_message(bool is_lobby, const std::string &sender, const std::string &message)
void public_message(bool is_lobby, const std::string &sender, const std::string &message)
void server_message(bool is_lobby, const std::string &sender, const std::string &message)
bool get_def_pref_sound(const std::string &id)
void player_leaves(bool is_lobby)
void game_created(const std::string &scenario, const std::string &name)
void player_joins(bool is_lobby)
bool get_def_pref_lobby(const std::string &id)
bool get_def_pref_notif(const std::string &id)