From 2a471eeb1aaf9ba6c14efeb4efe49caba3a21f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Sun, 23 Jun 2013 07:54:33 +0000 Subject: [PATCH] Addec quick combat to system options window. Compile fixes [I don't know why it has compiled for me before]. --- client/GUIClasses.cpp | 11 +++++++++++ client/GUIClasses.h | 3 ++- client/NetPacksClient.cpp | 6 +++--- config/schemas/settings.json | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index fa6a552b5..415d856de 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -3529,6 +3529,10 @@ CSystemOptionsWindow::CSystemOptionsWindow(): boost::bind(&CSystemOptionsWindow::toggleReminder, this, true), boost::bind(&CSystemOptionsWindow::toggleReminder, this, false), std::map(), CGI->generaltexth->zelp[361].second, false, "sysopchk.def", NULL, 246, 87, false); + quickCombat = new CHighlightableButton( + boost::bind(&CSystemOptionsWindow::toggleQuickCombat, this, true), boost::bind(&CSystemOptionsWindow::toggleQuickCombat, this, false), + std::map(), CGI->generaltexth->zelp[362].second, false, "sysopchk.def", NULL, 246, 87+32, false); + newCreatureWin = new CHighlightableButton( boost::bind(&CSystemOptionsWindow::toggleCreatureWin, this, true), boost::bind(&CSystemOptionsWindow::toggleCreatureWin, this, false), std::map(), cwHelp, false, "sysopchk.def", NULL, 246, 183, false); @@ -3538,6 +3542,7 @@ CSystemOptionsWindow::CSystemOptionsWindow(): std::map(), fsHelp, false, "sysopchk.def", NULL, 246, 215, false); showReminder->select(settings["adventure"]["heroReminder"].Bool()); + quickCombat->select(settings["adventure"]["quickCombat"].Bool()); newCreatureWin->select(settings["general"]["classicCreatureWindow"].Bool()); fullscreen->select(settings["video"]["fullscreen"].Bool()); @@ -3597,6 +3602,12 @@ void CSystemOptionsWindow::toggleReminder(bool on) heroReminder->Bool() = on; } +void CSystemOptionsWindow::toggleQuickCombat(bool on) +{ + Settings quickCombat = settings.write["adventure"]["quickCombat"]; + quickCombat->Bool() = on; +} + void CSystemOptionsWindow::toggleCreatureWin(bool on) { Settings classicCreatureWindow = settings.write["general"]["classicCreatureWindow"]; diff --git a/client/GUIClasses.h b/client/GUIClasses.h index 47e8ab23e..8dce581d1 100644 --- a/client/GUIClasses.h +++ b/client/GUIClasses.h @@ -742,7 +742,7 @@ private: //CHighlightableButton * showPath; CHighlightableButton * showReminder; - //CHighlightableButton * quickCombat; + CHighlightableButton * quickCombat; //CHighlightableButton * videoSubs; CHighlightableButton * newCreatureWin; CHighlightableButton * fullscreen; @@ -767,6 +767,7 @@ private: //functions for checkboxes void toggleReminder(bool on); + void toggleQuickCombat(bool on); void toggleCreatureWin(bool on); void toggleFullscreen(bool on); diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index d444cf9b8..43752cea0 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -34,7 +34,7 @@ #define CALL_IN_PRIVILAGED_INTS(function, ...) \ do \ { \ - BOOST_FOREACH(IGameEventsReceiver *ger, cl->privilagedGameEventReceivers) \ + BOOST_FOREACH(auto &ger, cl->privilagedGameEventReceivers) \ ger->function(__VA_ARGS__); \ } while(0) @@ -66,7 +66,7 @@ #define BATTLE_INTERFACE_CALL_RECEIVERS(function,...) \ do \ { \ - BOOST_FOREACH(IBattleEventsReceiver *ber, cl->privilagedBattleEventReceivers)\ + BOOST_FOREACH(auto & ber, cl->privilagedBattleEventReceivers)\ ber->function(__VA_ARGS__); \ } while(0) @@ -81,7 +81,7 @@ #define CALL_IN_ALL_INTERFACES(function, ...) \ do \ { \ - std::map ints = cl->playerint; \ + auto ints = cl->playerint; \ for(auto i = ints.begin(); i != ints.end(); i++)\ CALL_ONLY_THAT_INTERFACE(i->first, function, __VA_ARGS__); \ } while(0) diff --git a/config/schemas/settings.json b/config/schemas/settings.json index 2fdcfc4f8..fc0133da3 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -71,7 +71,7 @@ "type" : "object", "additionalProperties" : false, "default": {}, - "required" : [ "heroSpeed", "enemySpeed", "scrollSpeed", "heroReminder" ], + "required" : [ "heroSpeed", "enemySpeed", "scrollSpeed", "heroReminder", "quickCombat" ], "properties" : { "heroSpeed" : { "type" : "number", @@ -88,6 +88,10 @@ "heroReminder" : { "type" : "boolean", "default" : true + }, + "quickCombat" : { + "type" : "boolean", + "default" : false } } },