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
Minimap improvements #5876
Minimap improvements #5876
Conversation
…traffic-minimap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :)
Code LGTM, one comment inline
But maybe we should not draw this information about roads and flags belonging to enemy players? |
We draw only what is in our visibility, imho. So if we would see it in real, near the border we could safely draw it in the minimap as well. But I am open for others opinions on this. |
ok, first problem where I might need some help: how to identify a building which is attacked |
Buildings do not currently have a concept of "under attack". When a soldier approaches an enemy militarysite, he notifies the site's attack target, which may choose to send out some defenders early and perhaps send a message. But the fact of the attack is not cached anywhere. This would need some non-trivial changes to militarysite and soldier code to implement properly. Alternatively, how about instead highlighting the positions of soldiers who are currently in the process of attacking or defending something? for (Widelands::Bob* bob = field->get_first_bob(); bob != nullptr; bob = bob->get_next_bob()) {
if (bob->descr()->type() == Widelands::MapObjectType::SOLDIER && dynamic_cast<Widelands::Soldier*>(bob)->is_on_battlefield()) {
color = ...;
break;
}
} |
nice idea will try to use that |
…traffic-minimap
first attempt for better contrast to terrain
…traffic-minimap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stupid mistake. Thanks for the help. should be fixed now |
This fixed it for flags but the fix needs to be applied to roads as well |
sorry I cant concentrate well today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, working great now :)
Type of change
New feature
Issue(s) closed
fixes #1781, fixes #2144, fixes #4466, fixes #2074
New behavior
Signal busy roads and flags with more then 5 wares on the minimap in the inverse color
How it works
Determine whether a flag or road is busy and inverse the display color
Possible regressions
Minimap visibilty
Screenshots
Additional context
things that still need implementation