Skip to content

Commit

Permalink
Address comments against #3246 in order to resolve #2016.
Browse files Browse the repository at this point in the history
* Remove unused notify_mode.NOTIFY_COUNT.
* Remove obsolete comment against mp_ui_alerts::items.
* Remove unused is_lobby parameter in mp_ui_alerts::game_created().
* Synchronise game_created sound in game_config.cfg with game_config.cpp.

(cherry picked from commit abaa77f)
  • Loading branch information
Wedge009 committed Aug 27, 2019
1 parent 169cff9 commit e4e2607
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions data/game_config.cfg
Expand Up @@ -106,6 +106,7 @@
game_user_leave = "leave.wav"
ready_for_start = "bell.wav"
game_has_begun = "gamestart.ogg"
game_created = "chat-highlight.ogg"

[status]
slowed="slowed.wav"
Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/lobby_info.cpp
Expand Up @@ -74,7 +74,7 @@ void do_notify(notify_mode mode, const std::string& sender, const std::string& m
mp_ui_alerts::public_message(true, sender, message);
break;
case NOTIFY_GAME_CREATED:
mp_ui_alerts::game_created(true, sender, message);
mp_ui_alerts::game_created(sender, message);
break;
default:
break;
Expand Down
1 change: 0 additions & 1 deletion src/game_initialization/lobby_info.hpp
Expand Up @@ -183,7 +183,6 @@ enum notify_mode {
NOTIFY_WHISPER_OTHER_WINDOW,
NOTIFY_LOBBY_JOIN,
NOTIFY_LOBBY_QUIT,
NOTIFY_COUNT,
NOTIFY_GAME_CREATED
};

Expand Down
6 changes: 2 additions & 4 deletions src/mp_ui_alerts.cpp
Expand Up @@ -50,14 +50,12 @@ bool notif_pref(const std::string& id)

} // end anonymous namespace

// Note: This list must agree with data/gui/.../lobby_sound_options.cfg
// @lilinitsy: As of 1.14, it seems the above comment is not true, but someone could check.
const std::vector<std::string> items {"player_joins", "player_leaves", "private_message", "friend_message", "public_message", "server_message", "ready_for_start", "game_has_begun", "turn_changed", "game_created"};

void game_created(bool is_lobby, const std::string & scenario, const std::string & name)
void game_created(const std::string & scenario, const std::string & name)
{
std::string id = "game_created";
if (is_lobby && !lobby_pref(id)) {
if (!lobby_pref(id)) {
return ;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mp_ui_alerts.hpp
Expand Up @@ -27,7 +27,7 @@ namespace mp_ui_alerts {
// Functions called when such an event occurs
void player_joins(bool is_lobby);
void player_leaves(bool is_lobby);
void game_created(bool is_lobby, const std::string & scenario, const std::string & name);
void game_created(const std::string & scenario, const std::string & name);
void public_message(bool is_lobby, const std::string & sender, const std::string & message);
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);
Expand Down

0 comments on commit e4e2607

Please sign in to comment.