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