Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Sep 29, 2023
1 parent d3c811d commit ab197b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ SUBSYSTEM_DEF(minimaps)
store_current_svg_coords(user, params["image"])

current_svg = get_current_tacmap_data(user, FALSE)

if(isxeno(user))
var/mob/living/carbon/xenomorph/xeno = user
xeno_maptext("The Queen has updated your hive mind map", "You sense something unusual...", xeno.hivenumber)
Expand Down
22 changes: 19 additions & 3 deletions tgui/packages/tgui/interfaces/DrawnMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,26 @@ export class DrawnMap extends Component {
this.containerRef = createRef();
this.flatImgSrc = this.props.flatImage;
this.backupImgSrc = this.props.backupImage;
this.state = {
mapLoad: true,
};
this.img = null;
this.svg = this.props.svgData;
}

componentWillMount() {
this.img = new Image();
this.img.src = this.flatImgSrc;
this.img.onload = () => {
this.setState({ mapLoad: true });
};

this.img.onerror = () => {
this.img.src = this.backupImgSrc;
this.setState({ mapLoad: false });
};
}

parseSvgData(svgDataArray) {
if (!svgDataArray) return null;
let lines = [];
Expand All @@ -35,16 +52,15 @@ export class DrawnMap extends Component {
height: '100%',
}}>
<img
src={this.flatImgSrc}
alt={this.backupImgSrc || 'Please wait for a new tacmap announcement'}
src={this.img.src}
style={{
position: 'absolute',
zIndex: 0,
}}
width={650}
height={590}
/>
{parsedSvgData && (
{parsedSvgData && this.state.mapLoad && (
<svg
xmlns="http://www.w3.org/2000/svg"
width={650}
Expand Down

0 comments on commit ab197b5

Please sign in to comment.