-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Fix pressed buttons background #4748
Conversation
a1exsh
commented
Dec 4, 2021
- Accept / Decline buttons.
- Position of pressed OKAY button in Extended Settings and System Options dialogs.
- Fix X-offset of buttons with a shadow. Overlooked that shadow correction was missing.
- Fix ICNs used for OKAY and CANCEL buttons in some dialogs:
- Battle Only
- Gift Resources
- Town Portal spell
- Fix too dark background on TRADE, EXIT and GIFT evil buttons
1. Accept / Decline buttons. 2. Position of pressed OKAY button in Extended Settings and System Options dialogs. 3. Fix X-offset of buttons with a shadow. Overlooked that shadow correction was missing. 4. Fix ICNs used for OKAY and CANCEL buttons in some dialogs: - Battle Only - Gift Resources - Town Portal spell 5. Fix too dark background on TRADE, EXIT and GIFT evil buttons
This is a follow-up on pressed button issues found in the course of #4350 |
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.
Hi @a1exsh , I left multiple code optimization comments. Would you mind to take a look at them?
Hi @Branikolog , can you please test these changes? |
Hello, @a1exsh ! Disabled OKAY button in hiring dialog: Right part of CONFIG button's shadow looks like straight vertical. Or is it just merged with background here? Left part of OKAY button in experimental settings has some dark places (looks like a shadow near both upper and bottom corners) in it's pressed state: Shadow for scrollbar is missing: No shadows for buttons in this window: Pressed OKAY button in battle options window is rendered wrong: Dismiss button also doesn't have horizontal shifting of letters, while EXIT button works well: |
@Branikolog thank you for having a look :) I have to guess what you see as a problem here — please be more specific :) Do you mean the corners that seem darker than the background?
Oh, man, it all started with this button and after all the changes it's still not right 🤦
Yep, the released button sprite in the original resources is missing that line present on the pressed state. We can actually fix it if we like. That's a known issue. Also the same scrollbar is not changing in evil interface mode: we most likely even have an issue about that already. ;) Ah, this dialog I've never seen before: my installation only supports English. How do you enable it in the first place? Do you need a special version of OG for that?
Cool find — I will check that!
I will have a look at Dismiss button as well (we have an issue about it, I think this one: #4537). |
The game changed much with you help! OG has a tons of UI problems, which are already not the case for fheroes2. There're only "a few" issues left to become flawless. ;)
Sorry for being not clear enough. :)
I believe all buttons and their shadows should have same visuals within the whole game. :)
True. But the issue is about disabled button's bottom line. Today I found out, that letters are shifted here in wrong manner, comparing to other buttons in game. |
No worries: it was almost obvious after zooming in. ;) Fixed.
Fixed by adding the missing parts of these buttons.
I will have a closer look on this now. |
You can visit language selection dialog using any version of the game. Fheroes2 is going to support any language we like, generating all letters from the OG resources soon. Can we also add shadows for that radio buttons? |
In my case I'm always getting "Your version of Heroes of Might and Magic II does not support any languages except English.", but I've just changed the condition locally to test.
Do we already have it some other dialog I can have a look at as example? |
Right now the only thing you need to get that menu to show is by having a .mo translation file of either one or more of the languages German, French or Polish in your Edit: |
I've downloaded compiled version of current PR. It already contains languages.
Oh my, I completely forgot to test evil interface. :) |
Nah, these are very different radio-buttons. Let's not touch this for now: it's out of scope of the PR anyway.
Please do: I always try to test both, but I cannot spot all issues :) I've also made an improvement for the Dismiss hero button. Turns out the original resources are inconsistent here: the pressed state is not shifted to the left as it should be. |
@Branikolog all comments addressed. Also found that the EXIT button on the High Scores dialog didn't hold the pressed state properly due to handling the monster animations — fixed that too. |
@a1exsh
Noticed that too, but thought it was not related to the issue. :) |
Hi @a1exsh , unrelated to this issue but previous one: if I change resolution of the game OKAY button has incorrect rendering: Do you observe such in your build? |
@ihhub yeah, I can also see it: some artifacts appear on the button after changing the resolution. Do you have ideas why would that happen and how to fix it? |
No ideas yet. I'll check what's wrong. |
Hi @a1exsh , I think it happens because we use |
Wow, really? I thought it's single-threaded... |
No, it's not. Please add |
But wouldn't that mean that we should not modify display image unless we coordinate with other threads potentially doing the same? And yet I haven't seen us doing it, and all worked fine. There must be something special to the code changing the resolution that breaks it, not related to threads, IMO. |
Hi, @a1exsh ! Could you, please, look at some problems I've found? I like, how you managed to handle text shifting in DISMISS button! Really nice! But the background is not ok near top left corner, being too bright. Also, while being inactive we have doubled left side of the button: Also, I've noticed the same double edges (left and bottom edges) of inactive MAX button in hiring dialog. Pressed "Exit Puzzle" button also have a tiny background flaw near upper left corner. Similar case for Exit button from "View World" mode. Also it seems to me, that shadows of buttons in scenario info have a small pieces missing. Am I right? Or it's just my eyes tired of pixel-hunting? |
Will do :)
Yeah, I need to invent some new way to mess the original resources — looks like all the magic we have so far is insufficient 😂
I've noticed it as well: need to check what happens in the disabled button code.
Yay, it's actually the same code as for the Dismiss button. Will check it as well.
Nice catch! There are entirely too many buttons in this game, that drives me crazy %)
I continue to be amazed by your pixel-hunting skills, @Branikolog ! :) In this case it's a defect of the OG button resource: one pixel of the darkest shade is missing. |
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.
clang-tidy
found issue(s) with the introduced code (1/1)
@Branikolog I've fixed the background corners around the Dismiss button — please have a look again :) Regarding the disabled state of Dismiss and Max buttons: there is no easy solution for that, unfortunately, as these buttons are not provided separately from the background in OG resources, and our algorithm cannot tell the difference between background and parts of the button. We might invent something new one day, but for now let's leave them like they are right now. Also, the PR topic is pressed buttons ;) We might want to do something about the View Puzzle / World buttons at some point, but I'd like to wrap this changeset first. |
Hi, @a1exsh ! Edit: Edit x2: |
Eagle-Eye! :) It should be fixed now. |
@ihhub I think this is now ready for the code review, as all found pixels flaws are addressed. ;) |
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.
Hi @a1exsh , I left few comments in this pull request. Could you please check them?
@ihhub thanks for having a look: I've pushed an update. |
@a1exsh , thank you so much for these changes! Also there are some extra performance improvement we could have done but let's skip them for now :) |