Added list of customizable poison/slow/petrify sounds to game_config

This commit is contained in:
Lari Nieminen 2015-08-28 23:34:42 +03:00
parent 95bab79eab
commit f6c6c482de
2 changed files with 16 additions and 0 deletions

View file

@ -166,6 +166,12 @@ namespace game_config
menu_expand = "expand.wav",
menu_contract = "contract.wav",
menu_select = "select.wav";
namespace status {
std::string poisoned = "poison.ogg",
slowed = "slowed.wav",
petrified = "petrified.ogg";
}
}
#ifdef WESNOTH_PATH
@ -315,6 +321,13 @@ namespace game_config
if (s.has_attribute("game_user_leave")) game_user_leave = s["game_user_leave"].str();
if (s.has_attribute("ready_for_start")) ready_for_start = s["ready_for_start"].str();
if (s.has_attribute("game_has_begun")) game_has_begun = s["game_has_begun"].str();
if(const config & ss = s.child("status")) {
using namespace game_config::sounds::status;
if (ss.has_attribute("poisoned")) poisoned = s["poisoned"].str();
if (ss.has_attribute("slowed")) slowed = s["slowed"].str();
if (ss.has_attribute("petrified")) petrified = s["petrified"].str();
}
}
}

View file

@ -152,6 +152,9 @@ namespace game_config
game_has_begun;
extern const std::string button_press, checkbox_release, slider_adjust,
menu_expand, menu_contract, menu_select;
namespace status {
extern std::string poisoned, slowed, petrified;
}
}
void load_config(const config &cfg);