File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ private void VerifyImperatorVersion(ConverterVersion converterVersion) {
311311 private void VerifyCK3Version ( ConverterVersion converterVersion ) {
312312 var path = Path . Combine ( CK3Path , "launcher/launcher-settings.json" ) ;
313313 CK3Version = GameVersion . ExtractVersionFromLauncher ( path ) ??
314+ GetCK3VersionFromTitusBranchFile ( ) ??
314315 throw new ConverterException ( "CK3 version could not be determined." ) ;
315316
316317 Logger . Info ( $ "CK3 version: { CK3Version . ToShortString ( ) } ") ;
@@ -325,6 +326,20 @@ private void VerifyCK3Version(ConverterVersion converterVersion) {
325326 }
326327 }
327328
329+ private GameVersion ? GetCK3VersionFromTitusBranchFile ( ) {
330+ var path = Path . Combine ( CK3Path , "titus_branch.txt" ) ;
331+
332+ if ( ! File . Exists ( path ) ) {
333+ Logger . Warn ( "titus_branch.txt not found" ) ;
334+ return null ;
335+ }
336+
337+ // The file contains the game version in the following format: release/X.Y.Z.
338+ var versionStr = File . ReadAllText ( path ) . Trim ( ) . Replace ( "release/" , "" ) ;
339+ var version = new GameVersion ( versionStr ) ;
340+ return version ;
341+ }
342+
328343 public void DetectSpecificCK3Mods ( ICollection < Mod > loadedMods ) {
329344 var tfeMod = loadedMods . FirstOrDefault ( m => m . Name . StartsWith ( "The Fallen Eagle" , StringComparison . Ordinal ) ) ;
330345 if ( tfeMod is not null ) {
You can’t perform that action at this time.
0 commit comments