1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 06:26:02 +00:00

Suite Osgild

This commit is contained in:
Yan Maniez 2020-01-16 21:25:11 +01:00
parent 9e296c3700
commit 7e68a3a286
17 changed files with 582 additions and 33 deletions

View file

@ -400,30 +400,67 @@ 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\port-sable");
await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\vercelise");
await ConvertMapAsync(@"..\..\..\..\..\Docs\Osgild\xelys");
}
static async Task ConvertMapAsync(string basename)
{
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
document.Load(@"..\..\..\..\..\Docs\Osgild\ferrance.map.html");
document.Load($"{basename}.map.html");
var svg = new XmlDocument();
var svgElt = svg.CreateElement("svg", "http://www.w3.org/2000/svg");
var svgElt = svg.CreateElement("svg", nsSvg);
svgElt.SetAttribute("style", "fill: transparent");
svg.AppendChild(svgElt);
var img = document.DocumentNode.SelectSingleNode("img");
var image = svg.CreateElement("image", nsSvg);
image.SetAttribute("href", img.GetAttributeValue("src", ""));
var width = img.GetAttributeValue("width","");
var height = img.GetAttributeValue("height", "");
svgElt.SetAttribute("viewBox", $"0 0 {width} {height}");
svgElt.AppendChild(image);
var areas = document.DocumentNode.SelectNodes("//area");
foreach(var area in areas)
{
var coords = area.GetAttributeValue("coords", "");
var coordsSplit = coords.Split(",");
var a = svg.CreateElement("a");
var a = svg.CreateElement("a", nsSvg);
a.SetAttribute("href", area.GetAttributeValue("href", ""));
a.SetAttribute("target", area.GetAttributeValue("target", ""));
var rect = svg.CreateElement("rect");
rect.SetAttribute("x", coordsSplit[0]);
var title = svg.CreateElement("title");
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]);
}
var title = svg.CreateElement("title", nsSvg);
title.InnerText = area.GetAttributeValue("alt", "");
rect.AppendChild(title);
a.AppendChild(rect);
shape.AppendChild(title);
a.AppendChild(shape);
svgElt.AppendChild(a);
}
svg.Save($"{basename}.svg");
}
static async Task ExtractYamlAsync()

View file

@ -1,8 +1,9 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<link href="style.css" rel="stylesheet" />
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Ferrance</h1>
@ -13,8 +14,8 @@
<b>Source :</b> <a href="https://www.black-book-editions.fr/produit.php?id=5894" target="_blank">Anathazerin</a> p7, S4 Les Faux-Monnayeurs p88
Carte par <b>Romje</b> :
<iframe src="ferrance.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="ferrance.svg" width="100%" type="image/svg+xml" />
</body>
</html>

28
Docs/Osgild/ferrance.svg Normal file
View file

@ -0,0 +1,28 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="ferrance.jpg" />
<a href="oceanpelurique.html" target="_parent">
<rect x="1" y="103" width="192" height="40">
<title>Océan Pelurique</title>
</rect>
</a>
<a href="oceanpelurique.html" target="_parent">
<rect x="1" y="1363" width="206" height="172">
<title>Océan Pelurique</title>
</rect>
</a>
<a href="port-sable.html" target="_parent">
<rect x="1348" y="1480" width="251" height="40">
<title>Port-Sable</title>
</rect>
</a>
<a href="fourche.html" target="_parent">
<rect x="1666" y="17" width="211" height="40">
<title>Fourche</title>
</rect>
</a>
<a href="valastir.html" target="_parent">
<rect x="1836" y="382" width="208" height="35">
<title>Valastir</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 880 B

View file

@ -1,8 +1,9 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Fourche</h1>
@ -11,8 +12,8 @@
<b>Source :</b> CB02 La course du printemps p149
Carte par <b>Romje</b> :
<iframe src="fourche.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="fourche.svg" width="100%" type="image/svg+xml" />
</body>
</html>

23
Docs/Osgild/fourche.svg Normal file
View file

@ -0,0 +1,23 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="fourche.jpg" />
<a href="virylene.html" target="_parent">
<rect x="28" y="100" width="212" height="34">
<title>Virylène</title>
</rect>
</a>
<a href="hauterive.html" target="_parent">
<rect x="1172" y="0" width="230" height="29">
<title>Hauterive</title>
</rect>
</a>
<a href="wyks.html" target="_parent">
<rect x="1876" y="1429" width="160" height="33">
<title>Wyks</title>
</rect>
</a>
<a href="ferrance.html" target="_parent">
<rect x="333" y="1476" width="215" height="34">
<title>Ferrance</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 700 B

View file

@ -1,8 +1,9 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Hauterive</h1>
@ -13,8 +14,8 @@
<b>Source :</b> CB01 La fille du seigneur de lhiver p143
Carte par <b>Romje</b> :
<iframe src="hauterive.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="hauterive.svg" width="100%" type="image/svg+xml" />
</body>
</html>

View file

@ -0,0 +1,8 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="hauterive.jpg" />
<a href="vercelise.html" target="_parent">
<rect x="1144" y="1500" width="224" height="33">
<title>Vercélise</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 279 B

View file

@ -0,0 +1,11 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body onload="init()">
<h1>Terres d'Osgild</h1>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="osgild.svg" width="100%" type="image/svg+xml" />
</body>
</html>

View file

@ -3,11 +3,7 @@
<title>Terres d'Osgild</title>
</head>
<frameset cols="50%, 50%">
<frame src="osgild.map.html" />
<frame src="osgild.body.html" />
<frame src="empty.html" id="details" name="details" />
<!--<frameset rows="50%,50%">
<frame src="empty.html" id="region" name="region" />
<frame src="empty.html" id="town" name="town" />
</frameset>-->
</frameset>
</html>
</html>

383
Docs/Osgild/osgild.svg Normal file
View file

@ -0,0 +1,383 @@
<svg style="fill: transparent" viewBox="0 0 2099 1485" xmlns="http://www.w3.org/2000/svg">
<image href="osgild.png" />
<a href="hauterive.html" target="details">
<circle cx="144" cy="466" r="12">
<title>Hauterive</title>
</circle>
</a>
<a href="vercelise.html" target="details">
<circle cx="139" cy="617" r="6">
<title>Vercélise</title>
</circle>
</a>
<a href="virylene.html" target="details">
<circle cx="97" cy="825" r="14">
<title>Virylène</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="181" cy="855" r="6">
<title>???</title>
</circle>
</a>
<a href="fourche.html" target="details">
<circle cx="247" cy="910" r="11">
<title>Fourche</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="349" cy="943" r="5">
<title>???</title>
</circle>
</a>
<a href="kron.html" target="details">
<circle cx="518" cy="548" r="12">
<title>Krön</title>
</circle>
</a>
<a href="fort-boueux.html" target="details">
<rect x="431" y="714" width="14" height="15">
<title>Fort-Boueux</title>
</rect>
</a>
<a href="hauterive.html" target="details">
<rect x="162" y="447" width="124" height="32">
<title>Hauterive</title>
</rect>
</a>
<a href="clairval.html" target="details">
<circle cx="423" cy="782" r="6">
<title>Clairval</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="421" cy="815" r="8">
<title>???</title>
</circle>
</a>
<a href="twemby.html" target="details">
<circle cx="533" cy="884" r="7">
<title>Twemby</title>
</circle>
</a>
<a href="wyks.html" target="details">
<circle cx="465" cy="960" r="11">
<title>Wyks</title>
</circle>
</a>
<a href="goruzkal.html" target="details">
<circle cx="229" cy="1052" r="7">
<title>Goruz Kal</title>
</circle>
</a>
<a href="rampart.html" target="details">
<circle cx="337" cy="1051" r="7">
<title>Rampart</title>
</circle>
</a>
<a href="ferrance.html" target="details">
<circle cx="253" cy="1172" r="14">
<title>Ferrance</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="330" cy="1167" r="7">
<title>???</title>
</circle>
</a>
<a href="port-sable.html" target="details">
<circle cx="279" cy="1306" r="12">
<title>Port-Sable</title>
</circle>
</a>
<a href="valastir.html" target="details">
<circle cx="462" cy="1138" r="12">
<title>Valastir</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="299" cy="212" r="12">
<title>???</title>
</circle>
</a>
<a href="fondsac.html" target="details">
<circle cx="521" cy="1050" r="7">
<title>Fondsac</title>
</circle>
</a>
<a href="fortcolline.html" target="details">
<circle cx="596" cy="979" r="6">
<title>Fort Colline</title>
</circle>
</a>
<a href="benastir.html" target="details">
<circle cx="606" cy="1077" r="11">
<title>Benastir</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="518" cy="1201" r="7">
<title>???</title>
</circle>
</a>
<a href="ormile.html" target="details">
<circle cx="683" cy="1080" r="6">
<title>Ormile</title>
</circle>
</a>
<a href="unknown.html" target="details">
<rect x="472" y="1289" width="13" height="14">
<title>???</title>
</rect>
</a>
<a href="unknown.html" target="details">
<rect x="560" y="1301" width="14" height="14">
<title>???</title>
</rect>
</a>
<a href="kaerimbor.html" target="details">
<circle cx="623" cy="1362" r="15">
<title>Kaerimbor</title>
</circle>
</a>
<a href="syndoril.html" target="details">
<circle cx="850" cy="799" r="13">
<title>Syndoril</title>
</circle>
</a>
<a href="timvir.html" target="details">
<circle cx="1076" cy="354" r="7">
<title>Timvir</title>
</circle>
</a>
<a href="felten.html" target="details">
<circle cx="1228" cy="343" r="12">
<title>Felten</title>
</circle>
</a>
<a href="keln.html" target="details">
<circle cx="1279" cy="427" r="14">
<title>Keln.html</title>
</circle>
</a>
<a href="unknown.html" target="details">
<rect x="1008" y="633" width="14" height="14">
<title>???</title>
</rect>
</a>
<a href="kaer-undun.html" target="details">
<rect x="1126" y="596" width="14" height="15">
<title>Kaer-Undün</title>
</rect>
</a>
<a href="faleze.html" target="details">
<circle cx="1218" cy="595" r="6">
<title>Falèze</title>
</circle>
</a>
<a href="fleck.html" target="details">
<circle cx="1176" cy="789" r="7">
<title>Fleck</title>
</circle>
</a>
<a href="boisardent.html" target="details">
<circle cx="1122" cy="835" r="6">
<title>Bois Ardent</title>
</circle>
</a>
<a href="keltium.html" target="details">
<circle cx="1626" cy="199" r="12">
<title>Keltium</title>
</circle>
</a>
<a href="veltium.html" target="details">
<circle cx="1523" cy="313" r="6">
<title>Veltium</title>
</circle>
</a>
<a href="feng.html" target="details">
<circle cx="1851" cy="250" r="13">
<title>Feng</title>
</circle>
</a>
<a href="panderium.html" target="details">
<circle cx="1773" cy="375" r="14">
<title>Panderium</title>
</circle>
</a>
<a href="foroc.html" target="details">
<circle cx="1854" cy="428" r="12">
<title>Foroc</title>
</circle>
</a>
<a href="tor-angul.html" target="details">
<rect x="1650" y="514" width="15" height="16">
<title>Tor-Angul</title>
</rect>
</a>
<a href="murlin.html" target="details">
<circle cx="1539" cy="633" r="7">
<title>Murlin</title>
</circle>
</a>
<a href="thorm.html" target="details">
<circle cx="1571" cy="686" r="12">
<title>Thorm</title>
</circle>
</a>
<a href="liziere.html" target="details">
<circle cx="1411" cy="713" r="7">
<title>Lizière</title>
</circle>
</a>
<a href="jarell.html" target="details">
<circle cx="1770" cy="691" r="14">
<title>Jarell</title>
</circle>
</a>
<a href="salmarez.html" target="details">
<circle cx="1560" cy="795" r="12">
<title>Salmarez</title>
</circle>
</a>
<a href="rivek.html" target="details">
<circle cx="1760" cy="768" r="6">
<title>Rivek</title>
</circle>
</a>
<a href="port-libre.html" target="details">
<circle cx="1345" cy="927" r="11">
<title>Port-libre</title>
</circle>
</a>
<a href="salant.html" target="details">
<circle cx="1201" cy="997" r="12">
<title>Salant</title>
</circle>
</a>
<a href="bonlieu.html" target="details">
<circle cx="863" cy="958" r="6">
<title>Bonlieu</title>
</circle>
</a>
<a href="unknown.html" target="details">
<rect x="986" y="966" width="16" height="15">
<title>???</title>
</rect>
</a>
<a href="unknown.html" target="details">
<circle cx="797" cy="1076" r="6">
<title>???</title>
</circle>
</a>
<a href="monastir.html" target="details">
<circle cx="843" cy="1072" r="11">
<title>Monastir</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="934" cy="1053" r="6">
<title>???</title>
</circle>
</a>
<a href="piemont.html" target="details">
<circle cx="1012" cy="1042" r="14">
<title>Piémont</title>
</circle>
</a>
<a href="forterive.html" target="details">
<circle cx="744" cy="1196" r="12">
<title>Forterive</title>
</circle>
</a>
<a href="unknown.html" target="details">
<circle cx="733" cy="1265" r="6">
<title>???</title>
</circle>
</a>
<a href="valpir.html" target="details">
<circle cx="949" cy="1165" r="6">
<title>Valpir</title>
</circle>
</a>
<a href="unknown.html" target="details">
<rect x="708" y="1347" width="14" height="15">
<title>???</title>
</rect>
</a>
<a href="xelys.html" target="details">
<circle cx="768" cy="1324" r="12">
<title>Xelys</title>
</circle>
</a>
<a href="maduk.html" target="details">
<circle cx="1150" cy="1184" r="12">
<title>Maduk</title>
</circle>
</a>
<a href="sinys.html" target="details">
<circle cx="1193" cy="1248" r="6">
<title>Sinys</title>
</circle>
</a>
<a href="guilde.html" target="details">
<circle cx="1672" cy="964" r="14">
<title>Guilde</title>
</circle>
</a>
<a href="ilduran.html" target="details">
<circle cx="1469" cy="1072" r="14">
<title>Ilduran</title>
</circle>
</a>
<a href="uldamar.html" target="details">
<circle cx="1350" cy="1323" r="12">
<title>Uldamar</title>
</circle>
</a>
<a href="okmur.html" target="details">
<circle cx="1560" cy="1187" r="11">
<title>Okmur</title>
</circle>
</a>
<a href="hauteroche.html" target="details">
<circle cx="1729" cy="1072" r="12">
<title>Hauteroche</title>
</circle>
</a>
<a href="mar-iridan.html" target="details">
<circle cx="1604" cy="1231" r="7">
<title>Mar-Iridan</title>
</circle>
</a>
<a href="paleseaux.html" target="details">
<circle cx="1840" cy="1191" r="12">
<title>Paleseaux</title>
</circle>
</a>
<a href="lycanis.html" target="details">
<circle cx="1955" cy="1150" r="12">
<title>Lycanis</title>
</circle>
</a>
<a href="illistar.html" target="details">
<circle cx="1929" cy="575" r="12">
<title>Illistar</title>
</circle>
</a>
<a href="guar.html" target="details">
<circle cx="1759" cy="574" r="7">
<title>Guar</title>
</circle>
</a>
<a href="provincedarsheim.html" target="details">
<rect x="106" y="508" width="122" height="65">
<title>Province d&amp;apos;Arsheim</title>
</rect>
</a>
<a href="vercelise.html" target="details">
<rect x="151" y="605" width="70" height="15">
<title>Vercélise</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,14 +1,15 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Port-Sable</h1>
Carte par <b>Romje</b> :
<iframe src="port-sable.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="port-sable.svg" width="100%" type="image/svg+xml" />
</body>
</html>

View file

@ -0,0 +1,18 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="port-sable.jpg" />
<a href="oceanpelurique.html" target="_parent">
<rect x="29" y="162" width="246" height="116">
<title>Océan Pelurique</title>
</rect>
</a>
<a href="ferrance.html" target="_parent">
<rect x="1521" y="1" width="217" height="28">
<title>Ferrance</title>
</rect>
</a>
<a href="desertdetanith.html" target="_parent">
<rect x="838" y="1500" width="332" height="34">
<title>Désert de Tanith</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 592 B

8
Docs/Osgild/scripts.js Normal file
View file

@ -0,0 +1,8 @@
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 + "%";
}
}

View file

@ -1,14 +1,15 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Vercelise</h1>
Carte par <b>Romje</b> :
<iframe src="vercelise.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="vercelise.svg" width="100%" type="image/svg+xml" />
</body>
</html>

13
Docs/Osgild/vercelise.svg Normal file
View file

@ -0,0 +1,13 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="vercelise.jpg" />
<a href="hauterive.html" target="_parent">
<rect x="889" y="0" width="234" height="28">
<title>Hauterive</title>
</rect>
</a>
<a href="virylene.html" target="_parent">
<rect x="783" y="1484" width="211" height="34">
<title>Virylène</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 420 B

View file

@ -1,14 +1,15 @@
<html>
<head>
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
<body onload="init()">
<pre>
<h1>Xélys</h1>
Carte par <b>Romje</b> :
<iframe src="xelys.map.html" width="100%" height="50%"/>
</pre>
<input type="range" min="30" max="250" value="100" id="range" /><br />
<object id="map" data="xelys.svg" width="100%" type="image/svg+xml" />
</body>
</html>

18
Docs/Osgild/xelys.svg Normal file
View file

@ -0,0 +1,18 @@
<svg style="fill: transparent" viewBox="0 0 2048 1536" xmlns="http://www.w3.org/2000/svg">
<image href="xelys.jpg" />
<a href="forterive.html" target="_parent">
<rect x="834" y="4" width="225" height="32">
<title>Forterive</title>
</rect>
</a>
<a href="boisdebaram.html" target="_parent">
<rect x="1084" y="7" width="207" height="26">
<title>Bois de Baram</title>
</rect>
</a>
<a href="kaerimbor.html" target="_parent">
<rect x="168" y="1486" width="244" height="40">
<title>Kaerimbor</title>
</rect>
</a>
</svg>

After

Width:  |  Height:  |  Size: 568 B