Player colored icons have issues in the latest commit (8093)

Bug #1327505 reported by Andre Novellino Gouvêa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Fix Released
Undecided
cybermind

Bug Description

Contrary to how it was working in commit 8874, team-colored icons in the unit's interface now no longer display the proper color. For instance, the buildings in a worker's submenu doesn't display the proper team-color. The same happens, for instance, with patrol icons.

The unit's own icon has its team color displayed perfectly, though.

Related branches

Revision history for this message
cybermind (iddqd-mail) wrote :

I don't have any problems(screenshot included). Have you updated both Wargus and Stratagus?

Changed in stratagus:
status: New → Incomplete
assignee: nobody → cybermind (iddqd-mail)
Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

Hey cybermind,

Thanks for your response!

I had previously tested only in Wyrmsun.

I tested it in Wargus and indeed you are correct that there it works.

After looking around for a bit, it seems that the reason why it works in Wargus but not in Wyrmsun is that in Wyrmsun each icon has its own image file, while in Wargus they all use the same image file. Another possible reason is that in Wyrmsun certain icons have different colors as the player color: the pallette index is always the same, of course, but for instance for many icons the player color is violet, while for the blacksmith's it is orange.

To explain the error I get a bit better, if I select a dwarven miner and open up the "build basic structure" submenu, then (even if I'm playing as the red player) the blacksmith will appear orange. If, then, I select a blacksmith of mine, and then select the miner and open up the "build basic structure" submenu again, then the blacksmith will appear red. If I select a blacksmith of the blue enemy and then open up the "build basic structure" submenu yet again, then the blacksmith will appear blue. That is, the icons for the commands in the unit interface appear as they are in the source file (i.e. player color orange if the source file has orange as the player color), unless I've selected a unit which happens to have that icon as its own icon, then it will appear according to that unit's player's color.

I think that possibly this isn't noticeable in Wargus because, as all icons are in one file, perhaps all icons using that graphic get updated when a unit is selected. So, when I select a red unit, all icons become red.

A commit to the engine's source code between 8874 and 8903 must have made the changes that made icons spread across multiple image files no longer work correctly in regards to the player color. A change done in commit 8883 seems to me to be the most likely source of this issue. I imagine that reverting the changes done to uibuttons_proc.cpp would solve the issue. I don't see any strong reason for the DrawUIButton function to need a player argument, since the player using a unit's command buttons will always be "ThisPlayer". Reverting the changes in uibuttons_proc.cpp would also require undoing the changes for when other files refer to the DrawUIButton function. In menus.h there was a change in the reference to the DrawUIButton function (to add the player argument), and the same happened in icons.cpp.

Revision history for this message
cybermind (iddqd-mail) wrote :

Fixed in rev.8904

Changed in stratagus:
status: Incomplete → Fix Committed
cybermind (iddqd-mail)
Changed in stratagus:
status: Fix Committed → Fix Released
milestone: none → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.