Skip to content

Commit

Permalink
Fix case of DLC folder #3
Browse files Browse the repository at this point in the history
  • Loading branch information
rquinio committed Jul 21, 2018
1 parent 03e1ee1 commit 649bf4e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion PortraitBuilder/Engine/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public List<DLC> LoadDLCs(Boolean clean) {
}

public List<DLC> LoadDLCs() {
string dlcFolder = Path.Combine(user.GameDir,"dlc");
string dlcFolder = Path.Combine(user.GameDir,"DLC");
logger.Info("Loading DLCs from " + dlcFolder);
List<DLC> dlcs = dlcReader.ParseFolder(dlcFolder);

Expand Down
2 changes: 1 addition & 1 deletion PortraitBuilder/Model/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class User {
public string DlcDir;

public override string ToString() {
return string.Format("CK2 directory {0}, Mod directory: {1}, DLC directory: {2}", GameDir, ModDir, DlcDir);
return string.Format("CK2 directory: {0}, Mod directory: {1}, DLC directory: {2}", GameDir, ModDir, DlcDir);
}
}
}
14 changes: 10 additions & 4 deletions PortraitBuilder/Parser/PortraitReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,22 @@ public PortraitData Parse(string dir) {
PortraitData data = new PortraitData();
try {
List<string> fileNames = new List<string>();
logger.Debug("Scanning for portrait data files in " + dir);
logger.Debug("Directories: " + Directory.GetDirectories(dir));

if (Directory.Exists(Path.Combine(dir, "interface"))) {
if (Directory.Exists(Path.Combine(dir, "interface"))) {
fileNames.AddRange(Directory.GetFiles(Path.Combine(dir, "interface"), "*.gfx"));
}
} else {
logger.Debug("Folder not found: " + Path.Combine(dir, "interface"));
}
// interface/portraits seems to be loaded after interface/, and override (cf byzantinegfx)
if (Directory.Exists(Path.Combine(dir, "interface", "portraits"))) {
fileNames.AddRange(Directory.GetFiles(Path.Combine(dir, "interface", "portraits"), "*.gfx"));
}
} else {
logger.Debug("Folder not found: " + Path.Combine(dir, "interface", "portraits"));
}

foreach (string fileName in fileNames) {
foreach (string fileName in fileNames) {
Parse(fileName, data);
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</tr>
<tr>
<td style="text-align:center">AppVeyor</td>
<td>.NET 4.5</td>
<td>.NET 4.6</td>
<td style="text-align:center"><a href="https://ci.appveyor.com/project/rquinio/portraitbuilder/branch/master"><img src="https://ci.appveyor.com/api/projects/status/ssardstb8qkm35sy/branch/master?svg=true" alt="AppVeyor build status" /></a></td>
</tr>
<tr>
Expand All @@ -34,7 +34,7 @@ See the dedicated [CK2 forum thread](https://forum.paradoxplaza.com/forum/index.

- Install [.NET 4.6](https://www.microsoft.com/en-US/download/details.aspx?id=48130)
- Start PortraitBuilder.exe
- Select your CK2 game directory (ex: C:\Program Files (x86)\Steam\SteamApps\common\Crusader Kings II). This value is kept into a file "gamedir".
- Select your CK2 game executable (ex: C:\Program Files (x86)\Steam\SteamApps\common\Crusader Kings II\CK2game.exe). This value is kept into a file "gamedir".
- Errors are logged to a log.txt file. Adding -logfull to PortraitBuilder.exe launch options will set log level to DEBUG.

## Mono users (Linux/Mac/Windows)
Expand Down

0 comments on commit 649bf4e

Please sign in to comment.