Browse Source

Addec quick combat to system options window.
Compile fixes [I don't know why it has compiled for me before].

Michał W. Urbańczyk 12 years ago
parent
commit
2a471eeb1a
4 changed files with 21 additions and 5 deletions
  1. 11 0
      client/GUIClasses.cpp
  2. 2 1
      client/GUIClasses.h
  3. 3 3
      client/NetPacksClient.cpp
  4. 5 1
      config/schemas/settings.json

+ 11 - 0
client/GUIClasses.cpp

@@ -3529,6 +3529,10 @@ CSystemOptionsWindow::CSystemOptionsWindow():
 		boost::bind(&CSystemOptionsWindow::toggleReminder, this, true), boost::bind(&CSystemOptionsWindow::toggleReminder, this, false),
 		std::map<int,std::string>(), 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<int,std::string>(), 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<int,std::string>(), cwHelp, false, "sysopchk.def", NULL, 246, 183, false);
@@ -3538,6 +3542,7 @@ CSystemOptionsWindow::CSystemOptionsWindow():
 		std::map<int,std::string>(), 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"];

+ 2 - 1
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);
 

+ 3 - 3
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<PlayerColor, CGameInterface*> 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)

+ 5 - 1
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
 				}
 			}
 		},