diff --git a/AideDeJeu/AideDeJeuCmd/Program.cs b/AideDeJeu/AideDeJeuCmd/Program.cs index 03411e4c..3c5ca4a8 100644 --- a/AideDeJeu/AideDeJeuCmd/Program.cs +++ b/AideDeJeu/AideDeJeuCmd/Program.cs @@ -403,18 +403,28 @@ namespace AideDeJeuCmd static string nsSvg = "http://www.w3.org/2000/svg"; static async Task ConvertMapsAsync() { - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\osgild"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\ferrance"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\fourche"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\hauterive"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\portsable"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\vercelise"); - await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\xelys"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\osgild"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\ferrance"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\fourche"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\hauterive"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\portsable"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\vercelise"); + //await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\xelys"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\alarian"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\gramlin"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\norven"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\rhu"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\smitin"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\talban"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\yelin"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\ystaad"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\talbethhav"); + await ConvertMapAsync(@"..\..\..\..\..\Docs\Alarian\yagotalb"); } static async Task ConvertMapAsync(string basename) { HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument(); - document.Load($"{basename}.map.html"); + document.Load($"{basename}.map"); var svg = new XmlDocument(); var svgElt = svg.CreateElement("svg", nsSvg); svgElt.SetAttribute("style", "fill: transparent"); @@ -429,47 +439,50 @@ namespace AideDeJeuCmd svgElt.AppendChild(image); var areas = document.DocumentNode.SelectNodes("//area"); - foreach(var area in areas) + if (areas != null) { - var coords = area.GetAttributeValue("coords", ""); - var coordsSplit = coords.Split(","); + foreach (var area in areas) + { + var coords = area.GetAttributeValue("coords", ""); + var coordsSplit = coords.Split(","); - var a = svg.CreateElement("a", nsSvg); - a.SetAttribute("href", area.GetAttributeValue("href", "")); - a.SetAttribute("target", area.GetAttributeValue("target", "")); - var shapeAttr = area.GetAttributeValue("shape", ""); - XmlElement shape = null; - if (shapeAttr == "rect") - { - shape = svg.CreateElement("rect", nsSvg); - shape.SetAttribute("x", coordsSplit[0]); - shape.SetAttribute("y", coordsSplit[1]); - shape.SetAttribute("width", (int.Parse(coordsSplit[2]) - int.Parse(coordsSplit[0])).ToString()); - shape.SetAttribute("height", (int.Parse(coordsSplit[3]) - int.Parse(coordsSplit[1])).ToString()); - } - if (shapeAttr == "circle") - { - shape = svg.CreateElement("circle", nsSvg); - shape.SetAttribute("cx", coordsSplit[0]); - shape.SetAttribute("cy", coordsSplit[1]); - shape.SetAttribute("r", coordsSplit[2]); - } - if (shapeAttr == "poly") - { - shape = svg.CreateElement("polygon", nsSvg); - var points = ""; - for(var i = 0; i < coordsSplit.Length / 2; i++) + var a = svg.CreateElement("a", nsSvg); + a.SetAttribute("href", area.GetAttributeValue("href", "")); + a.SetAttribute("target", area.GetAttributeValue("target", "")); + var shapeAttr = area.GetAttributeValue("shape", ""); + XmlElement shape = null; + if (shapeAttr == "rect") { - points += $"{coordsSplit[i*2]},{coordsSplit[i*2+1]} "; + shape = svg.CreateElement("rect", nsSvg); + shape.SetAttribute("x", coordsSplit[0]); + shape.SetAttribute("y", coordsSplit[1]); + shape.SetAttribute("width", (int.Parse(coordsSplit[2]) - int.Parse(coordsSplit[0])).ToString()); + shape.SetAttribute("height", (int.Parse(coordsSplit[3]) - int.Parse(coordsSplit[1])).ToString()); } - points = points.Trim(); - shape.SetAttribute("points", points); + if (shapeAttr == "circle") + { + shape = svg.CreateElement("circle", nsSvg); + shape.SetAttribute("cx", coordsSplit[0]); + shape.SetAttribute("cy", coordsSplit[1]); + shape.SetAttribute("r", coordsSplit[2]); + } + if (shapeAttr == "poly") + { + shape = svg.CreateElement("polygon", nsSvg); + var points = ""; + for (var i = 0; i < coordsSplit.Length / 2; i++) + { + points += $"{coordsSplit[i * 2]},{coordsSplit[i * 2 + 1]} "; + } + points = points.Trim(); + shape.SetAttribute("points", points); + } + var title = svg.CreateElement("title", nsSvg); + title.InnerText = area.GetAttributeValue("alt", "").Replace("'", "'"); + shape.AppendChild(title); + a.AppendChild(shape); + svgElt.AppendChild(a); } - var title = svg.CreateElement("title", nsSvg); - title.InnerText = area.GetAttributeValue("alt", "").Replace("'","'"); - shape.AppendChild(title); - a.AppendChild(shape); - svgElt.AppendChild(a); } svg.Save($"{basename}.svg"); } diff --git a/Docs/Alarian/alarian.html b/Docs/Alarian/alarian.html new file mode 100644 index 00000000..15900df6 --- /dev/null +++ b/Docs/Alarian/alarian.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/alarian.map b/Docs/Alarian/alarian.map new file mode 100644 index 00000000..f12ad094 --- /dev/null +++ b/Docs/Alarian/alarian.map @@ -0,0 +1,17 @@ + + + + + + + + +Norven +Ystaad +Talban +Yelin +Rhü +Gramlin +Smitin +Rhagarron + diff --git a/Docs/Alarian/alarian.png b/Docs/Alarian/alarian.png new file mode 100644 index 00000000..98c548f3 Binary files /dev/null and b/Docs/Alarian/alarian.png differ diff --git a/Docs/Alarian/alarian.svg b/Docs/Alarian/alarian.svg new file mode 100644 index 00000000..89598ade --- /dev/null +++ b/Docs/Alarian/alarian.svg @@ -0,0 +1,43 @@ + + + + + Norven + + + + + Ystaad + + + + + Talban + + + + + Yelin + + + + + Rhü + + + + + Gramlin + + + + + Smitin + + + + + Rhagarron + + + \ No newline at end of file diff --git a/Docs/Alarian/gramlin.html b/Docs/Alarian/gramlin.html new file mode 100644 index 00000000..617424c3 --- /dev/null +++ b/Docs/Alarian/gramlin.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Osgild/osgild.map b/Docs/Alarian/gramlin.map similarity index 56% rename from Docs/Osgild/osgild.map rename to Docs/Alarian/gramlin.map index e7a0e6ba..3015f544 100644 --- a/Docs/Osgild/osgild.map +++ b/Docs/Alarian/gramlin.map @@ -1,4 +1,4 @@ - + @@ -6,5 +6,4 @@ -Coeur-du-bois diff --git a/Docs/Alarian/gramlin.png b/Docs/Alarian/gramlin.png new file mode 100644 index 00000000..8c6162b5 Binary files /dev/null and b/Docs/Alarian/gramlin.png differ diff --git a/Docs/Alarian/gramlin.svg b/Docs/Alarian/gramlin.svg new file mode 100644 index 00000000..8dcfdbf6 --- /dev/null +++ b/Docs/Alarian/gramlin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/index.html b/Docs/Alarian/index.html new file mode 100644 index 00000000..80290eed --- /dev/null +++ b/Docs/Alarian/index.html @@ -0,0 +1,12 @@ + + +Terres d'Alarian + + + + + + + + diff --git a/Docs/Alarian/norven.html b/Docs/Alarian/norven.html new file mode 100644 index 00000000..a70b0185 --- /dev/null +++ b/Docs/Alarian/norven.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/norven.map b/Docs/Alarian/norven.map new file mode 100644 index 00000000..25c829a1 --- /dev/null +++ b/Docs/Alarian/norven.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/norven.png b/Docs/Alarian/norven.png new file mode 100644 index 00000000..84cabfee Binary files /dev/null and b/Docs/Alarian/norven.png differ diff --git a/Docs/Alarian/norven.svg b/Docs/Alarian/norven.svg new file mode 100644 index 00000000..39ecba60 --- /dev/null +++ b/Docs/Alarian/norven.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/rhagarron.html b/Docs/Alarian/rhagarron.html new file mode 100644 index 00000000..22639f59 --- /dev/null +++ b/Docs/Alarian/rhagarron.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/rhu.html b/Docs/Alarian/rhu.html new file mode 100644 index 00000000..30c4f86c --- /dev/null +++ b/Docs/Alarian/rhu.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/rhu.map b/Docs/Alarian/rhu.map new file mode 100644 index 00000000..b1b794e5 --- /dev/null +++ b/Docs/Alarian/rhu.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/rhu.png b/Docs/Alarian/rhu.png new file mode 100644 index 00000000..c22839a0 Binary files /dev/null and b/Docs/Alarian/rhu.png differ diff --git a/Docs/Alarian/rhu.svg b/Docs/Alarian/rhu.svg new file mode 100644 index 00000000..dfdc2caa --- /dev/null +++ b/Docs/Alarian/rhu.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/scripts.js b/Docs/Alarian/scripts.js new file mode 100644 index 00000000..0d33faba --- /dev/null +++ b/Docs/Alarian/scripts.js @@ -0,0 +1,21 @@ +function init() { + var range = document.getElementById("range"); + var map = document.getElementById("map"); + map.style.width = "" + range.value + "%"; + range.oninput = function() { + map.style.width = "" + range.value + "%"; + } + //range.addEventListener("wheel", onwheel); +} + +function onwheel() { + var range = document.getElementById("range"); + var map = document.getElementById("map"); + //alert(range.value); + //var percent = range.value.toString().substring(0, range.length - 1); + //alert(percent); + range.value = range.value + 10; + map.style.width = "" + range.value + "%"; + //map.style.width = "" + (parseInt(range.value) + 10) + "%"; + console.log(range.value); +} \ No newline at end of file diff --git a/Docs/Alarian/smitin.html b/Docs/Alarian/smitin.html new file mode 100644 index 00000000..628fbc03 --- /dev/null +++ b/Docs/Alarian/smitin.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/smitin.map b/Docs/Alarian/smitin.map new file mode 100644 index 00000000..5e0a3ec8 --- /dev/null +++ b/Docs/Alarian/smitin.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/smitin.png b/Docs/Alarian/smitin.png new file mode 100644 index 00000000..abc937e7 Binary files /dev/null and b/Docs/Alarian/smitin.png differ diff --git a/Docs/Alarian/smitin.svg b/Docs/Alarian/smitin.svg new file mode 100644 index 00000000..09a38752 --- /dev/null +++ b/Docs/Alarian/smitin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/style.css b/Docs/Alarian/style.css new file mode 100644 index 00000000..f917f5db --- /dev/null +++ b/Docs/Alarian/style.css @@ -0,0 +1,11 @@ +@import url('https://fonts.googleapis.com/css?family=UnifrakturCook:700&display=swap'); +@import url('https://fonts.googleapis.com/css?family=Noto+Serif&display=swap'); +pre { + font-family: 'Noto Serif', serif; +} +body { + font-family: 'Noto Serif', serif; +} +h1 { + font-family: 'UnifrakturCook', cursive; +} diff --git a/Docs/Alarian/talban.html b/Docs/Alarian/talban.html new file mode 100644 index 00000000..6f44457b --- /dev/null +++ b/Docs/Alarian/talban.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/talban.map b/Docs/Alarian/talban.map new file mode 100644 index 00000000..f543b50a --- /dev/null +++ b/Docs/Alarian/talban.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/talban.png b/Docs/Alarian/talban.png new file mode 100644 index 00000000..1add9761 Binary files /dev/null and b/Docs/Alarian/talban.png differ diff --git a/Docs/Alarian/talban.svg b/Docs/Alarian/talban.svg new file mode 100644 index 00000000..44972a94 --- /dev/null +++ b/Docs/Alarian/talban.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/talbethhav.html b/Docs/Alarian/talbethhav.html new file mode 100644 index 00000000..9fc2846f --- /dev/null +++ b/Docs/Alarian/talbethhav.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/talbethhav.map b/Docs/Alarian/talbethhav.map new file mode 100644 index 00000000..87ee9059 --- /dev/null +++ b/Docs/Alarian/talbethhav.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/talbethhav.png b/Docs/Alarian/talbethhav.png new file mode 100644 index 00000000..6847b340 Binary files /dev/null and b/Docs/Alarian/talbethhav.png differ diff --git a/Docs/Alarian/talbethhav.svg b/Docs/Alarian/talbethhav.svg new file mode 100644 index 00000000..075c5a07 --- /dev/null +++ b/Docs/Alarian/talbethhav.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/yagotalb.html b/Docs/Alarian/yagotalb.html new file mode 100644 index 00000000..7a8a82db --- /dev/null +++ b/Docs/Alarian/yagotalb.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/yagotalb.map b/Docs/Alarian/yagotalb.map new file mode 100644 index 00000000..c14b6c0f --- /dev/null +++ b/Docs/Alarian/yagotalb.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/yagotalb.png b/Docs/Alarian/yagotalb.png new file mode 100644 index 00000000..75bad4de Binary files /dev/null and b/Docs/Alarian/yagotalb.png differ diff --git a/Docs/Alarian/yagotalb.svg b/Docs/Alarian/yagotalb.svg new file mode 100644 index 00000000..beb11bf4 --- /dev/null +++ b/Docs/Alarian/yagotalb.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/yelin.html b/Docs/Alarian/yelin.html new file mode 100644 index 00000000..6c3604cc --- /dev/null +++ b/Docs/Alarian/yelin.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/yelin.map b/Docs/Alarian/yelin.map new file mode 100644 index 00000000..b39ae789 --- /dev/null +++ b/Docs/Alarian/yelin.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Docs/Alarian/yelin.png b/Docs/Alarian/yelin.png new file mode 100644 index 00000000..8e833dbb Binary files /dev/null and b/Docs/Alarian/yelin.png differ diff --git a/Docs/Alarian/yelin.svg b/Docs/Alarian/yelin.svg new file mode 100644 index 00000000..c42f3237 --- /dev/null +++ b/Docs/Alarian/yelin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Docs/Alarian/ystaad.html b/Docs/Alarian/ystaad.html new file mode 100644 index 00000000..9e4f4328 --- /dev/null +++ b/Docs/Alarian/ystaad.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/Docs/Alarian/ystaad.map b/Docs/Alarian/ystaad.map new file mode 100644 index 00000000..1e24c703 --- /dev/null +++ b/Docs/Alarian/ystaad.map @@ -0,0 +1,13 @@ + + + + + + + + +Talbeth-Hav +Talbeth-Hav +Yago-talb +Yago-talb + diff --git a/Docs/Alarian/ystaad.png b/Docs/Alarian/ystaad.png new file mode 100644 index 00000000..1a0f5c43 Binary files /dev/null and b/Docs/Alarian/ystaad.png differ diff --git a/Docs/Alarian/ystaad.svg b/Docs/Alarian/ystaad.svg new file mode 100644 index 00000000..8b7dcd14 --- /dev/null +++ b/Docs/Alarian/ystaad.svg @@ -0,0 +1,23 @@ + + + + + Talbeth-Hav + + + + + Talbeth-Hav + + + + + Yago-talb + + + + + Yago-talb + + + \ No newline at end of file diff --git a/Docs/Osgild/fourchevive.html b/Docs/Osgild/fourchevive.html new file mode 100644 index 00000000..a2aa5eac --- /dev/null +++ b/Docs/Osgild/fourchevive.html @@ -0,0 +1,8 @@ + + + + + +

Fourchevive

+ + diff --git a/Docs/Osgild/osgild.map.html b/Docs/Osgild/osgild.map.html index 565229ad..208cbba4 100644 --- a/Docs/Osgild/osgild.map.html +++ b/Docs/Osgild/osgild.map.html @@ -29,7 +29,7 @@ Fondsac Fort Colline Benastir -???6 +Fourchevive ? Ormile ???7 ???8