Skip to content

Commit

Permalink
1.5 support - MINOR update (#535)
Browse files Browse the repository at this point in the history
* Update rakaly

* Add mapping for law_frontier_colonization

* Equipment variant types should not be quoted.

* Don't directly convert dynamic tags

* Roll version
  • Loading branch information
Idhrendur authored Nov 24, 2023
1 parent ec1a67e commit 8c5d83e
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows_build_test_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ jobs:
echo '# Version info' | out-file data/version.txt -encoding ASCII
echo '' | out-file data/version.txt -encoding ASCII -append
echo 'version = "${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}.${{ steps.version_number.outputs.patch }}"' | out-file data/version.txt -encoding ASCII -append
echo 'name = "Blamey"' | out-file data/version.txt -encoding ASCII -append
echo 'name = "Chen"' | out-file data/version.txt -encoding ASCII -append
echo 'source = "Vic3"' | out-file data/version.txt -encoding ASCII -append
echo 'minSource = "1.3"' | out-file data/version.txt -encoding ASCII -append
echo 'maxSource = "1.4"' | out-file data/version.txt -encoding ASCII -append
echo 'maxSource = "1.5"' | out-file data/version.txt -encoding ASCII -append
echo 'target = "HoI4"' | out-file data/version.txt -encoding ASCII -append
echo 'minTarget = "1.13"' | out-file data/version.txt -encoding ASCII -append
echo 'maxTarget = "1.13"' | out-file data/version.txt -encoding ASCII -append
Expand Down
2 changes: 1 addition & 1 deletion Vic3ToHoI4-Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Vic3 to HoI4"
#define MyAppVersion "0.2 Blamey"
#define MyAppVersion "0.3 Chen"
#define MyAppPublisher "Paradox Game Converters Group"
#define MyAppURL "https://paradoxgameconverters.com/"
#define MyAppExeName "ConverterFrontend.exe"
Expand Down
5 changes: 5 additions & 0 deletions data/configurables/ideology_mappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ law_multicultural = { democratic = 50 communism = 50 fascism = -50 neutrality

# colonial_affairs
law_no_colonial_affairs = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 }
law_frontier_colonization = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 } # TBD
law_colonial_resettlement = { democratic = 0 communism = 0 fascism = 30 neutrality = 20 }
law_colonial_exploitation = { democratic = 0 communism = 0 fascism = 30 neutrality = 20 }

Expand Down Expand Up @@ -180,6 +181,7 @@ law_multicultural = { conservatism = 25 liberalism = 50 socialism = 75 }

# colonial_affairs
law_no_colonial_affairs = { conservatism = 0 liberalism = 0 socialism = 0 } # TBD
law_frontier_colonization = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 } # TBD
law_colonial_resettlement = { conservatism = 0 liberalism = 0 socialism = 0 } # TBD
law_colonial_exploitation = { conservatism = 0 liberalism = 0 socialism = 0 } # TBD

Expand Down Expand Up @@ -325,6 +327,7 @@ law_multicultural = { marxism = 100 leninism = 100 stalinism = 75 anti_revision

# colonial_affairs
law_no_colonial_affairs = { marxism = 0 leninism = 0 stalinism = 0 anti_revisionism = 0 anarchist_communism = 0 } # TBD
law_frontier_colonization = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 } # TBD
law_colonial_resettlement = { marxism = 0 leninism = 0 stalinism = 0 anti_revisionism = 0 anarchist_communism = 0 } # TBD
law_colonial_exploitation = { marxism = 0 leninism = 0 stalinism = 0 anti_revisionism = 0 anarchist_communism = 0 } # TBD

Expand Down Expand Up @@ -470,6 +473,7 @@ law_multicultural = { gen_nazism = -100 fascism_ideology = 0 falangism = -25 re

# colonial_affairs
law_no_colonial_affairs = { gen_nazism = 0 fascism_ideology = 0 falangism = 0 rexism = 0 } # TBD
law_frontier_colonization = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 } # TBD
law_colonial_resettlement = { gen_nazism = 0 fascism_ideology = 0 falangism = 0 rexism = 0 } # TBD
law_colonial_exploitation = { gen_nazism = 0 fascism_ideology = 0 falangism = 0 rexism = 0 } # TBD

Expand Down Expand Up @@ -615,6 +619,7 @@ law_multicultural = { despotism = -100 oligarchism = -75 anarchism = 100 moder

# colonial_affairs
law_no_colonial_affairs = { despotism = 0 oligarchism = 0 anarchism = 0 moderatism = 0 centrism = 0 } # TBD
law_frontier_colonization = { democratic = 0 communism = 0 fascism = 0 neutrality = 0 } # TBD
law_colonial_resettlement = { despotism = 0 oligarchism = 0 anarchism = 0 moderatism = 0 centrism = 0 } # TBD
law_colonial_exploitation = { despotism = 0 oligarchism = 0 anarchism = 0 moderatism = 0 centrism = 0 } # TBD

Expand Down
4 changes: 2 additions & 2 deletions data/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Documentation: https://hoi4.paradoxwikis.com/Victoria_3_to_Hearts_of_Iron_IV_con
SUPPORTED VERSIONS
----
Hoi4 - 1.13
Vic3 - 1.0-1.4
Vic3 - 1.0-1.5


----
Expand All @@ -34,7 +34,7 @@ Idhrendur - Project Lead, Programming, Analysis
Zemurin - Programming, Code reviews, Tools
IhateTrains - Programming, Code reviews, Tools
Drasilabyss - Programming
Ultrapotassium - Programming
Ultrapotassium - Programming
cetvrtak - Data Files
DaJay42 - Data Files
gawquon - Data Files
Expand Down
Binary file added data/release_banners/ChenReleaseBanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions data/version.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Version info

version = "0.2.0"
name = "Blamey"
version = "0.3.0"
name = "Chen"
source = "Vic3"
minSource = "1.3"
maxSource = "1.4"
maxSource = "1.5"
target = "HoI4"
minTarget = "1.13"
maxTarget = "1.13"
Binary file modified external/rakaly/librakaly.so
Binary file not shown.
Binary file modified external/rakaly/rakaly.dll
Binary file not shown.
Binary file modified external/rakaly/rakaly.dll.lib
Binary file not shown.
10 changes: 10 additions & 0 deletions src/mappers/country/country_mapper_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ std::map<std::string, std::string> ImportMappingRules(std::string_view country_m
return country_mapping_rules;
}


bool IsDynamicTag(std::string_view tag)
{
return tag.size() == 3 && tag.starts_with('D') && std::isdigit(tag[1]) && std::isdigit(tag[2]);
}

} // namespace


Expand Down Expand Up @@ -75,6 +81,10 @@ mappers::CountryMappingCreator::CountryMappingCreator(std::string_view country_m

AddCountryWithVicId = [this](const vic3::Country& country) -> bool {
const auto& vic3_tag = country.GetTag();
if (IsDynamicTag(vic3_tag))
{
return false;
}
if (vic3_tag.length() == 3 && used_hoi4_tags_.emplace(vic3_tag).second)
{
country_mappings_.emplace(country.GetNumber(), vic3_tag);
Expand Down
2 changes: 2 additions & 0 deletions src/mappers/country/country_mapper_creator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ TEST(MappersCountryCountryMapperCreator, SourceTagAsPrimaryFallback)
{1, vic3::Country({.number = 1, .tag = "TAG"})},
{2, vic3::Country({.number = 2, .tag = "TWO"})},
{3, vic3::Country({.number = 3, .tag = "TWO"})},
{4, vic3::Country({.number = 4, .tag = "D01"})},
};

const CountryMapper country_mapper = CreateCountryMappings("", source_countries);
EXPECT_EQ(country_mapper.GetHoiTag(1), "TAG");
EXPECT_EQ(country_mapper.GetHoiTag(2), "TWO");
EXPECT_EQ(country_mapper.GetHoiTag(3), "Z00"); // "TWO" was already taken, so fall back to the Znn system
EXPECT_EQ(country_mapper.GetHoiTag(4), "Z01"); // "D01" is a dynamic tag, fall back to the Znn system
}

TEST(MappersCountryCountryMapperCreator, CivilWarCountryIsSecondary)
Expand Down
2 changes: 1 addition & 1 deletion src/out_hoi4/military/out_equipment_variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ std::ostream& out::operator<<(std::ostream& out_stream, const hoi4::EquipmentVar
}
if (!equipment_variant.GetType().empty())
{
out_stream << fmt::format("\t\ttype = \"{}\"\n", equipment_variant.GetType());
out_stream << fmt::format("\t\ttype = {}\n", equipment_variant.GetType());
}
for (const auto& [key, value]: equipment_variant.GetTextItems())
{
Expand Down
2 changes: 1 addition & 1 deletion src/out_hoi4/military/out_equipment_variant_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TEST(Outhoi4MilitaryEquipmentvariant, VariantCanBeOutput)
EXPECT_EQ(out.str(),
"\tcreate_equipment_variant = {\n"
"\t\tname = \"test_variant\"\n"
"\t\ttype = \"test_type\"\n"
"\t\ttype = test_type\n"
"\t\tcomplex_item = {\n\tfoo = bar\n}\n"
"\t}\n");
}
Expand Down

0 comments on commit 8c5d83e

Please sign in to comment.