Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
Handle new mappings files a bit better.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtremenak committed Oct 19, 2011
1 parent 71c9760 commit aad5f9c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions ProvinceMapper/LaunchForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ private void button1_Click(object sender, EventArgs e)
Program.targetMap = new MapReader(targetMap, Program.targetDef.provinces, PushStatusUpdate);

// read existing mappings (if any)
if (tbMappingsFile.Text.Trim() != String.Empty)
string mappingFile = tbMappingsFile.Text.Trim();
if (mappingFile != String.Empty && File.Exists(mappingFile))
{
lblStatus.Text = "Parse Existing Mappings";
Application.DoEvents();
Program.mappings = new MappingReader(tbMappingsFile.Text, tbSourceTag.Text,
Program.mappings = new MappingReader(mappingFile, tbSourceTag.Text,
tbDestTag.Text, Program.sourceDef.provinces, Program.targetDef.provinces, PushStatusUpdate);
}
else
{
Program.mappings = new MappingReader(mappingFile, tbSourceTag.Text, tbDestTag.Text);
}
}

private void btnExit_Click(object sender, EventArgs e)
Expand Down
7 changes: 7 additions & 0 deletions ProvinceMapper/MappingReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ class MappingReader

private string path;

public MappingReader(string _path, string _srcTag, string _destTag)
{
srcTag = _srcTag;
destTag = _destTag;
path = _path;
}

public MappingReader(string _path, string _srcTag, string _destTag, List<Province> srcProvs, List<Province> destProvs, StatusUpdate su)
{
srcTag = _srcTag;
Expand Down
3 changes: 2 additions & 1 deletion cpp_version/EU3toV2Converter/changeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,5 @@ Revision Version Updated Log Message
271 C++ Allow Mantua to map to Lombardia.
272 C++ Fix Yap Islands/Micronesia Sea mappings.
273 N/A Clean up some stray files
274 C# Introduce Province Mapper tool
274 ProvinceMapper Introduce Province Mapper tool
275 ProvinceMapper Handle new mappings files a bit better

0 comments on commit aad5f9c

Please sign in to comment.