Add context and comment attributes where useful

Add context and comment attributes to all translated XML elements in the
simulation that can specify any string -- unlike "Rank", which has to be
"Basic", "Advanced", or "Elite".
Most of them aren't used right now, but they can be in the
future and by mods, without touching the schemas again.

Fixes #8540
This commit is contained in:
Vantha
2025-11-16 10:34:53 +01:00
committed by Vantha
parent 84d4dbc506
commit 7032293207
4 changed files with 86 additions and 1 deletions
@@ -105,12 +105,17 @@ Attack.prototype.Schema =
"<element>" +
"<anyName a:help='Currently one of Melee, Ranged, Capture or Slaughter.'/>" +
"<interleave>" +
"<element name='AttackName' a:help='Name of the attack, to be displayed in the GUI. Optionally includes a translate context attribute.'>" +
"<element name='AttackName' a:help='Name of the attack, to be displayed in the GUI.'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
AttackHelper.BuildAttackEffectsSchema() +
@@ -44,6 +44,16 @@ BuildRestrictions.prototype.Schema =
"<element name='Distance' a:help='Specifies distance restrictions on this building, relative to buildings from the given category.'>" +
"<interleave>" +
"<element name='FromClass'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"<optional><element name='MinDistance'><data type='positiveInteger'/></element></optional>" +
@@ -9,6 +9,16 @@ Formation.prototype.Schema =
"</data>" +
"</element>" +
"<element name='DisabledTooltip' a:help='Tooltip shown when the formation is disabled.'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"<element name='SpeedMultiplier' a:help='The speed of the formation is determined by the minimum speed of all members, multiplied with this number.'>" +
@@ -25,10 +25,30 @@ Identity.prototype.Schema =
"</element>" +
"</optional>" +
"<element name='GenericName' a:help='Generic English-language name for this entity.'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"<optional>" +
"<element name='SpecificName' a:help='Specific native-language name for this entity.'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"</optional>" +
@@ -39,16 +59,46 @@ Identity.prototype.Schema =
"</optional>" +
"<optional>" +
"<element name='Tooltip'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='History'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Rank'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<choice>" +
"<value>Basic</value>" +
"<value>Advanced</value>" +
@@ -66,6 +116,16 @@ Identity.prototype.Schema =
"</optional>" +
"<optional>" +
"<element name='VisibleClasses' a:help='Optional list of space-separated classes applying to this entity. These classes will also be visible in various GUI elements. Choices include: Academy, Amphitheater, Archer, ArmyCamp, ArrowShip, Arsenal, ArtilleryTower, Auxiliary, Axeman, Barracks, BoltShooter, BoltTower, Bribable, Builder, Camel, Cataphract, Cavalry, Centurion, Champion, Chariot, Citizen, City, Civilian, Civic, CivilCentre, Colony, Corral, Council, Crossbowman, Defensive, Dock, Dog, Economic, Elephant, ElephantStable, Embassy, Farmstead, Field, Fireship, FishingBoat, Forge, Fortress, Gate, Gladiator, GreatTower, Gymnasium, Hall, Healer, Heavy, Hero, House, IceHouse, Ignited, Immortal, ImperialCourt, ImperialMinistry, Infantry, Javelineer, Kennel, LaoziGate, Legionary, Library, Lighthouse, Longsword, Maceman, Melee, Market, Mercenary, Military, Minister, Monument, Naval, NavalRam, NavalSiege, Outpost, Palace, Palisade, Pikeman, Pillar, Pirate, Pyramid, Ram, Range, Ranged, Relic, Resource, RotaryMill, ScoutShip, SentryTower, Ship, Shipyard, Shrine, Siege, SiegeTower, SiegeWall, Slave, Slinger, Soldier, Spearman, Stable, Stoa, StoneThrower, StoneTower, Storehouse, Support, Swordsman, Syssiton, Temple, TempleOfAmun, TempleOfApedemak, TempleOfIsis, TempleOfMars, TempleOfVesta, Tent, Theater, Tower, Town, Trade, Trader, TriumphalArch, Trumpeter, Village, Wall, Warship, Wonder, Worker.'>" +
"<optional>" +
"<attribute name='context'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<optional>" +
"<attribute name='comment'>" +
"<text/>" +
"</attribute>" +
"</optional>" +
"<attribute name='datatype'>" +
"<value>tokens</value>" +
"</attribute>" +