Skip to content
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

The Hero info button in level up dialog has black background #7514

Closed
2 tasks done
zenseii opened this issue Aug 5, 2023 · 3 comments · Fixed by #7519
Closed
2 tasks done

The Hero info button in level up dialog has black background #7514

zenseii opened this issue Aug 5, 2023 · 3 comments · Fixed by #7519
Assignees
Labels
bug Something doesn't work regression Something went wrong in previous commits
Milestone

Comments

@zenseii
Copy link
Collaborator

zenseii commented Aug 5, 2023

Preliminary checks

Platform

Windows

Describe the bug

Seen here:
image

It is the same background as it has in the adventure map buttons
image

Save file

No need.

Additional info

No response

@zenseii zenseii added bug Something doesn't work regression Something went wrong in previous commits labels Aug 5, 2023
@zenseii zenseii self-assigned this Aug 5, 2023
@zenseii zenseii added this to the 1.0.7 milestone Aug 5, 2023
@zenseii
Copy link
Collaborator Author

zenseii commented Aug 5, 2023

I believe this is a regression from this PR:
#7449

@LeHerosInconnu
Copy link

I confirm this in my current game with version 1.0.6 7494.

In fheroes2:

Hero button 01

Here is the save file:
Hero button 01.zip

@zenseii
Copy link
Collaborator Author

zenseii commented Aug 5, 2023

The problem here is that the function calls AddTransparency(), but after the PR mentioned above these images do not have a transformation layer, rightly so since they don't need them where they are supposed to be used on the right side column of the adventure map, and you can't add transparency to a single-layered image if I've understood things correctly.

case ICN::GOOD_ARMY_BUTTON:
case ICN::GOOD_MARKET_BUTTON: {
_icnVsSprite[id].resize( 2 );
LoadOriginalICN( ICN::ADVBTNS );
const int releasedIndex = ( id == ICN::GOOD_ARMY_BUTTON ) ? 0 : 4;
_icnVsSprite[id][0] = GetICN( ICN::ADVBTNS, releasedIndex );
_icnVsSprite[id][1] = GetICN( ICN::ADVBTNS, releasedIndex + 1 );
// Make all black pixels transparent.
AddTransparency( _icnVsSprite[id][0], 36 );
AddTransparency( _icnVsSprite[id][1], 36 );
AddTransparency( _icnVsSprite[id][1], 61 ); // remove the extra brown border
return true;
}

I'm not entirely sure if I should figure out how to add transparency back to this button and create a new modified ICN, or if I should just add a fixed uniform button background to it and make a new ICN. Most likely the second option is the way to go.

Any advice would be appreciated, @ihhub and @Districh-ru.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work regression Something went wrong in previous commits
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants