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

Commit

Permalink
Merge branch 'ProvinceMapper'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	ProvinceMapper/Changelog.txt
#	ProvinceMapper/DefinitionReader.cs
#	ProvinceMapper/Form1.Designer.cs
#	ProvinceMapper/Form1.cs
#	ProvinceMapper/Form1.resx
#	ProvinceMapper/LocalizationReader.cs
#	ProvinceMapper/Mapping.cs
#	ProvinceMapper/MappingReader.cs
#	ProvinceMapper/Properties/Resources.Designer.cs
#	ProvinceMapper/Properties/Settings.Designer.cs
#	ProvinceMapper/Province.cs
#	ProvinceMapper/ProvinceMapper.csproj
#	ProvinceMapper/ProvinceMapper.sln
  • Loading branch information
Idhrendur committed Apr 1, 2016
2 parents 83fcf80 + 8f10f6a commit 4a0dba0
Show file tree
Hide file tree
Showing 13 changed files with 1,996 additions and 0 deletions.
44 changes: 44 additions & 0 deletions ProvinceMapper/Changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
ProvinceMapper Change Log

0.9H
- Read YML province names from EU4 localization.
- Handle being given a fresh province mappings file.
- Preserve initial lines as initial lines.

0.9G
- Skip over unused and RNW provinces in the definition file instead of throwing out errors.
- Handle reading mapping files with multiple sections.
- Display and interact with mapping files with multiple sections.
- Keep 'resettable' information in the file.

0.9F
- Add keyboard shortcuts:
- F2: Change comment text
- F3: Insert new comment above selected
- F4: Insert new mapping above selected
- Ctrl+Plus: Move selected up
- Ctrl+Minus: Move selected down
- Fix memory leak associated with map zoom

0.9E
- Allow one-sided province mappings
- Mark one-sided and many-to-many province mappings in the output comments

0.9D
- Make map inversion optional (CK2 doesn't need it)
- Throw a more useful error when a province is mapped but doesn't exist in game data

0.9C
- Optionally read province names from localization instead of map data

0.9B
- Preserve comment lines and allow new comments to be added
- Fix boundary conditions for move up/move down
- Fix handling of input files containing whitespace at BOL

0.9A
- Save settings from launch dialog
- Support map zoom

0.9
- initial release
38 changes: 38 additions & 0 deletions ProvinceMapper/DefinitionReader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ProvinceMapper
{
class DefinitionReader
{
public DefinitionReader(string path, StatusUpdate su)
{
StreamReader sr = new StreamReader(path, Encoding.GetEncoding(1252));
sr.ReadLine(); // discard first line
while (!sr.EndOfStream)
{
string province = sr.ReadLine();
string[] provinceTokens = province.Split(';');
if ( (provinceTokens[4] == "RNW") || ((provinceTokens[4].Length > 5) && (provinceTokens[4].Substring(0, 6) == "Unused")) )
{
continue;
}
try
{
Province p = new Province(provinceTokens);
provinces.Add(p);
}
catch
{
}
su(100.0 * sr.BaseStream.Position / sr.BaseStream.Length);
}
sr.Close();
}

public List<Province> provinces = new List<Province>();
}
}
301 changes: 301 additions & 0 deletions ProvinceMapper/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4a0dba0

Please sign in to comment.