You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
984 B
37 lines
984 B
#include "game_mode.hpp" |
|
|
|
#include <function_ref.hpp> |
|
|
|
#include "options.h" |
|
|
|
namespace devilution { |
|
namespace { |
|
std::vector<tl::function_ref<void()>> IsHellfireChangeHandlers; |
|
|
|
void OptionGameModeChanged() |
|
{ |
|
gbIsHellfire = *GetOptions().GameMode.gameMode == StartUpGameMode::Hellfire; |
|
for (tl::function_ref<void()> handler : IsHellfireChangeHandlers) { |
|
handler(); |
|
} |
|
} |
|
const auto OptionChangeHandlerGameMode = (GetOptions().GameMode.gameMode.SetValueChangedCallback(OptionGameModeChanged), true); |
|
|
|
void OptionSharewareChanged() |
|
{ |
|
gbIsSpawn = *GetOptions().GameMode.shareware; |
|
} |
|
const auto OptionChangeHandlerShareware = (GetOptions().GameMode.shareware.SetValueChangedCallback(OptionSharewareChanged), true); |
|
} // namespace |
|
|
|
bool gbIsSpawn; |
|
bool gbIsHellfire; |
|
bool gbVanilla; |
|
bool forceHellfire; |
|
|
|
void AddIsHellfireChangeHandler(tl::function_ref<void()> callback) |
|
{ |
|
IsHellfireChangeHandlers.push_back(callback); |
|
} |
|
|
|
} // namespace devilution
|
|
|