Skip to content

Commit

Permalink
Added XSD header to XML mods
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiephan committed Aug 16, 2024
1 parent 92d5bb6 commit 95e3973
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii"?>
<?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================== -->
<!-- This file is generated via "npm run build:mimicabilities" -->
Expand All @@ -10,7 +10,7 @@
<!-- Such as "Ultimate1Unlocked" for ultimates -->
<!-- Please also manually add the behavior to the units. -->

<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">

<!-- ///////////////////////////////////-->
<!-- Start Abilities in {mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialveteran.stormmap/base.stormdata/GameData/AbilData.xml}-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii" standalone="no"?>
<?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================== -->
<!-- This file is generated via "npm run build:mimicbehaviors" -->
Expand All @@ -10,7 +10,7 @@
<!-- such as "PermaBlind" to "MBPermablind" -->
<!-- And add the behavior to selected units, such as with chat command "addbehavior" (adb MBPermaBlind). -->

<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">
<CBehaviorAbility id="MBGraveGolemMegaStunCastScan">
<Buttons Face="MBGraveGolemMegaStunCastScan_ToggleOn" Type="AbilCmd" AbilCmd="MBGraveGolemMegaStunCastScan_AbilBehavior,On"/>
<Buttons Face="MBGraveGolemMegaStunCastScan_ToggleOff" Type="AbilCmd" AbilCmd="MBGraveGolemMegaStunCastScan_AbilBehavior,Off"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<?xml version="1.0" encoding="UTF-8"?>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">

<!-- This file enabled the glowing icons (e.g when Zuljin D active) on Q W E R D buttons -->
<!-- To have a button glowing, simply add the following behaviors (e.g using tools such as "adb" chat command): -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="us-ascii" standalone="no"?>
<?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================== -->
<!-- This file is generated via "npm run build:mimicmodels" -->
Expand All @@ -7,7 +7,7 @@
<!-- That allow a model to be spawned as a Unit. -->
<!-- To prevent collision, all Mimic Models Unit's id will have prefixed "UN" -->

<Catalog>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">
<CUnit id="UN_t" parent="StormHero">
<BehaviorArray Link="PermaInvulnerable"/>
<WeaponArray Link="FootmanMinion"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<?xml version="1.0" encoding="UTF-8"?>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">

<!-- This file enables applying a permanent armor by adding the behavior of: -->

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<?xml version="1.0" encoding="UTF-8"?>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">
<!-- This file does absolutely nothing but for testing the Generate XML tool.
As well as force git to upload the empty directory.
You can delete this file at any will and do a "npm run build:xml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
<?xml version="1.0" encoding="UTF-8"?>
<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">
<!-- This file does absolutely nothing but for testing the Generate XML tool.
As well as force git to upload the empty directory.
You can delete this file at any will and do a "npm run build:xml"
Expand Down
5 changes: 3 additions & 2 deletions scripts/main/buildmimicabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const XMLFiles = HeroesFiles.ReadEach(HeroesFiles.AllXMLs);

const idPrefix = 'M';

let finalXML = '<?xml version="1.0" encoding="us-ascii"?>\n\n';
let finalXML = '<?xml version="1.0" encoding="UTF-8"?>\n\n';
finalXML += '<!-- ======================================================== -->\n';
finalXML += '<!-- This file is generated via "npm run build:mimicabilities" -->\n';
finalXML += '<!-- ======================================================== -->\n';
Expand All @@ -21,7 +21,8 @@ finalXML += '<!-- To prevent collision, all Mimic Abilities\' id will have prefi
finalXML += '<!-- Some Abilities required a specific behavior to be unlocked, which will shown next to the ability below. -->\n';
finalXML += '<!-- Such as "Ultimate1Unlocked" for ultimates -->\n';
finalXML += '<!-- Please also manually add the behavior to the units. -->\n';
finalXML += '\n<Catalog>\n';
// eslint-disable-next-line max-len
finalXML += '\n<Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd">\n';

XMLFiles.forEach((obj) => {
XMLParser(obj.fileData, (err, result) => {
Expand Down
11 changes: 8 additions & 3 deletions scripts/main/helper/buildmimicXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ module.exports = (configParam) => {
rootName: 'Catalog',
xmldec: {
version: '1.0',
encoding: 'us-ascii',
standalone: false,
encoding: 'UTF-8',
},
});

const mainObj = {};
const mainObj = {
$: {
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
// eslint-disable-next-line max-len
'xsi:noNamespaceSchemaLocation': 'https://raw.githubusercontent.com/jamiephan/HeroesOfTheStorm_Gamedata/master/xsd/latest.xsd',
},
};

if (!(config.generation.pre === null || typeof config.generation.pre === 'undefined')) {
config.generation.pre.forEach((o) => {
Expand Down

0 comments on commit 95e3973

Please sign in to comment.