Skip to content

Improve ward map visuals #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/components/Match/VisionMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Checkbox from 'material-ui/Checkbox';
import Visibility from 'material-ui/svg-icons/action/visibility';
import VisibilityOff from 'material-ui/svg-icons/action/visibility-off';
import {
isRadiant,
playerColors,
// transformations,
} from 'utility';
import Table from 'components/Table';
Expand All @@ -20,7 +20,7 @@ import {
const obsWard = (style, stroke, iconSize) => (<svg style={style} width={iconSize} height={iconSize} xmlns="http://www.w3.org/2000/svg">
<g>
<title>Observer</title>
<circle fill="#ffff00" strokeWidth="5" stroke={stroke} r={iconSize * 0.4} cy={iconSize / 2} cx={iconSize / 2} fillOpacity="0.4" />
<circle fill="#ffff00" strokeWidth="2.5" stroke={stroke} r={iconSize * 0.4} cy={iconSize / 2} cx={iconSize / 2} fillOpacity="0.3" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this 2.5 and not 2?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have 2 for sentries. And since this is just the border, I think both of them should have the same value 2.

</g>
<defs>
<filter id="_blur">
Expand All @@ -32,7 +32,7 @@ const obsWard = (style, stroke, iconSize) => (<svg style={style} width={iconSize
const senWard = (style, stroke, iconSize) => (<svg style={style} width={iconSize} height={iconSize} xmlns="http://www.w3.org/2000/svg">
<g>
<title>Sentry</title>
<circle fill="#0000ff" strokeWidth="5" stroke={stroke} r={iconSize * 0.4} cy={iconSize / 2} cx={iconSize / 2} fillOpacity="0.4" />
<circle fill="#0000ff" strokeWidth="2" stroke={stroke} r={iconSize * 0.4} cy={iconSize / 2} cx={iconSize / 2} fillOpacity="0.3" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a cyan color?

</g>
<defs>
<filter id="_blur">
Expand Down Expand Up @@ -63,8 +63,9 @@ class VisionMap extends React.Component {
const match = this.props.match;
const width = this.props.width;
const enabledIndex = this.state.enabledIndex;
const iconSize = width / 12;
const style = ward => ({
const senSize = width / 12;
const obsSize = senSize * (1600 / 850); // 850 radius sentry, 1600 radius observer
const style = (ward, iconSize) => ({
position: 'absolute',
top: ((width / 127) * ward.y) - (iconSize / 2),
left: ((width / 127) * ward.x) - (iconSize / 2),
Expand All @@ -76,9 +77,9 @@ class VisionMap extends React.Component {
if (match && match.players && match.players[index]) {
const obs = (match.players[index].posData && match.players[index].posData.obs) || [];
const sen = (match.players[index].posData && match.players[index].posData.sen) || [];
const stroke = isRadiant(match.players[index].player_slot) ? 'green' : 'red';
obs.forEach(ward => obsIcons.push(obsWard(style(ward), stroke, iconSize)));
sen.forEach(ward => senIcons.push(senWard(style(ward), stroke, iconSize)));
const stroke = playerColors[match.players[index].player_slot];
obs.forEach(ward => obsIcons.push(obsWard(style(ward, obsSize), stroke, obsSize)));
sen.forEach(ward => senIcons.push(senWard(style(ward, senSize), stroke, senSize)));
}
}
});
Expand Down