Explorar o código

- fixed modifiers keys behaviour in TextInput
- erm compilation is optional in cmake (too memory-consuming for old systems)
- minor fixes

Ivan Savenko %!s(int64=13) %!d(string=hai) anos
pai
achega
d72c44e4c3

+ 3 - 1
CMakeLists.txt

@@ -48,5 +48,7 @@ add_subdirectory(lib)
 add_subdirectory(client)
 add_subdirectory(server)
 add_subdirectory(AI)
-add_subdirectory(Scripting/ERM)
+if (NOT DISABLE_ERM)
+	add_subdirectory(Scripting/ERM)
+endif()
 

+ 1 - 1
client/CAdvmapInterface.cpp

@@ -982,7 +982,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
 	assert(sel);
 	LOCPLINT->cb->setSelection(sel);
 	selection = sel;
-	if (LOCPLINT->battleInt == NULL && active & GENERAL)
+	if (LOCPLINT->battleInt == NULL && LOCPLINT->makingTurn)
 	{
 		auto pos = sel->visitablePos();
 		auto tile = LOCPLINT->cb->getTile(pos);

+ 4 - 0
client/CMusicHandler.cpp

@@ -410,6 +410,10 @@ void CMusicHandler::playMusicFromSet(std::string whichSet, int entryID, bool loo
 		tlog0 << "Error: playing non-existing entry " << entryID << " from set: " << whichSet << "\n";
 		return;
 	}
+
+	if (current && current->isTrack( selectedEntry->second))
+		return;
+
 	queueNext(new MusicEntry(this, "", selectedEntry->second, loop));
 }
 

+ 1 - 1
client/CVideoHandler.cpp

@@ -749,7 +749,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
 	}
   
 	// Open codec
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 17, 0)
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 6, 0)
 	if ( avcodec_open(codecContext, codec) < 0 )
 #else
 	if ( avcodec_open2(codecContext, codec, NULL) < 0 )

+ 1 - 1
client/GUIClasses.cpp

@@ -362,7 +362,7 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
 						}
 
 						GH.pushInt(new CSplitWindow(owner->highlighted->creature, boost::bind(&CGarrisonInt::splitStacks, owner, _1, _2),
-						                            minLeft, minRight, count, owner->highlighted->count));
+						                            minLeft, minRight, owner->highlighted->count, count));
 						refr = true;
 					}
 					else if(creature != owner->highlighted->creature) //swap

+ 4 - 1
client/UIFramework/CIntObjectClasses.cpp

@@ -1554,7 +1554,10 @@ void CTextInput::keyPressed( const SDL_KeyboardEvent & key )
 			text.resize(text.size()-1);
 		break;
 	default:
-		text += key.keysym.unicode; //TODO 16-/>8
+		if (key.keysym.unicode < ' ')
+			return;
+		else
+			text += key.keysym.unicode; //TODO 16-/>8
 		break;
 	}
 

+ 1 - 1
config/buildings.json

@@ -722,7 +722,7 @@
 				{ "id" : 20, "defname" : "TBFRBOAT.def", "x" : 197, "y" : 294, "border" : "TOFDCK1.bmp",  "area" : "TZFDCK1.bmp" }
 			],
 			"blit_order" : [ 16, 15, 14, 34, 41, 31, 38, 10, 11, 12, 13, 29, 0, 1, 2, 33, 40, 30, 18, 37, 19, 5, 36, 43, 26 ],
-			"creatures" : [ [98, 99], [100, 101], [102, 103], [104, 105], [106, 107], [108, 109], [110, 111] ],
+			"creatures" : [ [98, 99], [100, 101], [104, 105], [106, 107], [102, 103], [108, 109], [110, 111] ],
 			"horde" : [ 0, null ],
 			"mage_guild" : 3,
 			"war_machine" : 6,