Browse Source

Merge remote-tracking branch 'upstream/develop' into develop

Xilmi 1 year ago
parent
commit
ca4a46466b

+ 3 - 0
CI/msvc/before_install.sh

@@ -5,3 +5,6 @@ curl -LfsS -o "vcpkg-export-${VCMI_BUILD_PLATFORM}-windows-v143.7z" \
 #rm -r -f vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug
 #rm -r -f vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug
 #mkdir -p vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
 #mkdir -p vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
 #cp vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/bin/* vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
 #cp vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/bin/* vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
+
+DUMPBIN_DIR=$(vswhere -latest -find **/dumpbin.exe | head -n 1)
+dirname "$DUMPBIN_DIR" > $GITHUB_PATH

+ 7 - 7
client/windows/CKingdomInterface.cpp

@@ -879,9 +879,9 @@ public:
 	std::shared_ptr<CAnimImage> background;
 	std::shared_ptr<CAnimImage> background;
 	std::vector<std::shared_ptr<CArtPlace>> arts;
 	std::vector<std::shared_ptr<CArtPlace>> arts;
 
 
-	ArtSlotsTab()
+	ArtSlotsTab(CIntObject * parent)
 	{
 	{
-		OBJECT_CONSTRUCTION;
+		OBJECT_CONSTRUCTION_TARGETED(parent);
 		background = std::make_shared<CAnimImage>(AnimationPath::builtin("OVSLOT"), 4);
 		background = std::make_shared<CAnimImage>(AnimationPath::builtin("OVSLOT"), 4);
 		pos = background->pos;
 		pos = background->pos;
 		for(int i=0; i<9; i++)
 		for(int i=0; i<9; i++)
@@ -897,9 +897,9 @@ public:
 	std::shared_ptr<CButton> btnLeft;
 	std::shared_ptr<CButton> btnLeft;
 	std::shared_ptr<CButton> btnRight;
 	std::shared_ptr<CButton> btnRight;
 
 
-	BackpackTab()
+	BackpackTab(CIntObject * parent)
 	{
 	{
-		OBJECT_CONSTRUCTION;
+		OBJECT_CONSTRUCTION_TARGETED(parent);
 		background = std::make_shared<CAnimImage>(AnimationPath::builtin("OVSLOT"), 5);
 		background = std::make_shared<CAnimImage>(AnimationPath::builtin("OVSLOT"), 5);
 		pos = background->pos;
 		pos = background->pos;
 		btnLeft = std::make_shared<CButton>(Point(269, 66), AnimationPath::builtin("HSBTNS3"), CButton::tooltip(), 0);
 		btnLeft = std::make_shared<CButton>(Point(269, 66), AnimationPath::builtin("HSBTNS3"), CButton::tooltip(), 0);
@@ -915,9 +915,9 @@ CHeroItem::CHeroItem(const CGHeroInstance * Hero)
 	OBJECT_CONSTRUCTION;
 	OBJECT_CONSTRUCTION;
 
 
 	artTabs.resize(3);
 	artTabs.resize(3);
-	auto arts1 = std::make_shared<ArtSlotsTab>();
-	auto arts2 = std::make_shared<ArtSlotsTab>();
-	auto backpack = std::make_shared<BackpackTab>();
+	auto arts1 = std::make_shared<ArtSlotsTab>(this);
+	auto arts2 = std::make_shared<ArtSlotsTab>(this);
+	auto backpack = std::make_shared<BackpackTab>(this);
 	artTabs[0] = arts1;
 	artTabs[0] = arts1;
 	artTabs[1] = arts2;
 	artTabs[1] = arts2;
 	artTabs[2] = backpack;
 	artTabs[2] = backpack;

+ 1 - 1
lib/battle/BattleInfo.cpp

@@ -209,7 +209,7 @@ BattleInfo * BattleInfo::setupBattle(const int3 & tile, TerrainId terrain, const
 	}
 	}
 
 
 	//randomize obstacles
 	//randomize obstacles
-	if (layout.obstaclesAllowed)
+	if (layout.obstaclesAllowed && !town)
  	{
  	{
 		RandGen r{};
 		RandGen r{};
 		auto ourRand = [&](){ return r.rand(); };
 		auto ourRand = [&](){ return r.rand(); };

+ 0 - 0
lib/mapObjects/CreatureBank.cpp


+ 0 - 0
lib/mapObjects/CreatureBank.h


+ 2 - 2
mapeditor/translation/chinese.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation>魔法卷轴 %1 没有分配任何实例,需要被移除</translation>
         <translation>魔法卷轴 %1 没有分配任何实例,需要被移除</translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation>宝物 %1 被地图设置禁止</translation>
         <translation>宝物 %1 被地图设置禁止</translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/czech.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/english.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/french.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation>Le défilement de sort %1 n&apos;a pas d&apos;instance assignée et doit être enlevé</translation>
         <translation>Le défilement de sort %1 n&apos;a pas d&apos;instance assignée et doit être enlevé</translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation>L&apos;artéfact %1 est interdit par la configuration de la carte</translation>
         <translation>L&apos;artéfact %1 est interdit par la configuration de la carte</translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/german.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/polish.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/portuguese.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/russian.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/spanish.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/ukrainian.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/translation/vietnamese.ts

@@ -1761,12 +1761,12 @@
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="148"/>
         <location filename="../validator.cpp" line="148"/>
-        <source>Spell scroll % 1 doesn&apos;t have instance assigned and must be removed</source>
+        <source>Spell scroll %1 doesn&apos;t have instance assigned and must be removed</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>
         <location filename="../validator.cpp" line="154"/>
         <location filename="../validator.cpp" line="154"/>
-        <source>Artifact % 1 is prohibited by map settings</source>
+        <source>Artifact %1 is prohibited by map settings</source>
         <translation type="unfinished"></translation>
         <translation type="unfinished"></translation>
     </message>
     </message>
     <message>
     <message>

+ 2 - 2
mapeditor/validator.cpp

@@ -145,13 +145,13 @@ std::set<Validator::Issue> Validator::validate(const CMap * map)
 							issues.insert({ tr("Spell scroll %1 is prohibited by map settings").arg(ins->storedArtifact->getScrollSpellID().toEntity(VLC->spells())->getNameTranslated().c_str()), false });
 							issues.insert({ tr("Spell scroll %1 is prohibited by map settings").arg(ins->storedArtifact->getScrollSpellID().toEntity(VLC->spells())->getNameTranslated().c_str()), false });
 					}
 					}
 					else
 					else
-						issues.insert({ tr("Spell scroll % 1 doesn't have instance assigned and must be removed").arg(ins->instanceName.c_str()), true });
+						issues.insert({ tr("Spell scroll %1 doesn't have instance assigned and must be removed").arg(ins->instanceName.c_str()), true });
 				}
 				}
 				else
 				else
 				{
 				{
 					if(ins->ID == Obj::ARTIFACT && map->allowedArtifact.count(ins->getArtifact()) == 0)
 					if(ins->ID == Obj::ARTIFACT && map->allowedArtifact.count(ins->getArtifact()) == 0)
 					{
 					{
-						issues.insert({ tr("Artifact % 1 is prohibited by map settings").arg(ins->getObjectName().c_str()), false });
+						issues.insert({ tr("Artifact %1 is prohibited by map settings").arg(ins->getObjectName().c_str()), false });
 					}
 					}
 				}
 				}
 			}
 			}