@@ -131,7 +131,9 @@ class Battle {
131131
132132 for ( const u of options . military ) {
133133 const label = capitalize ( u . name . replace ( / _ / g, " " ) ) ;
134- headers += `<th data-tip="${ label } ">${ u . icon } </th>` ;
134+ const isExternal = u . icon . startsWith ( "http" ) ;
135+ const iconHTML = isExternal ? `<img src="${ u . icon } " width="15" height="15">` : u . icon ;
136+ headers += `<th data-tip="${ label } ">${ iconHTML } </th>` ;
135137 }
136138
137139 headers += "<th data-tip='Total military''>Total</th></tr></thead>" ;
@@ -145,9 +147,13 @@ class Battle {
145147 const state = pack . states [ regiment . state ] ;
146148 const distance = ( Math . hypot ( this . y - regiment . by , this . x - regiment . bx ) * distanceScale ) | 0 ; // distance between regiment and its base
147149 const color = state . color [ 0 ] === "#" ? state . color : "#999" ;
150+
151+ const isExternal = regiment . icon . startsWith ( "http" ) ;
152+ const iconHtml = isExternal
153+ ? `<image href="${ regiment . icon } " x="0.1em" y="0.1em" width="1.2em" height="1.2em"></image>`
154+ : `<text x="50%" y="1em" style="text-anchor: middle">${ regiment . icon } </text>` ;
148155 const icon = `<svg width="1.4em" height="1.4em" style="margin-bottom: -.6em; stroke: #333">
149- <rect x="0" y="0" width="100%" height="100%" fill="${ color } "></rect>
150- <text x="0" y="1.04em" style="">${ regiment . icon } </text></svg>` ;
156+ <rect x="0" y="0" width="100%" height="100%" fill="${ color } "></rect>${ iconHtml } </svg>` ;
151157 const body = `<tbody id="battle${ state . i } -${ regiment . i } ">` ;
152158
153159 let initial = `<tr class="battleInitial"><td>${ icon } </td><td class="regiment" data-tip="${
0 commit comments