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

Add missing button shadows in dialogs #4350

Merged
merged 50 commits into from
Dec 3, 2021

Conversation

a1exsh
Copy link
Contributor

@a1exsh a1exsh commented Oct 9, 2021

Relates to #4349

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 10, 2021

@ihhub can you please trigger that check again: it built OK, but just failed to upload the artifacts.

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 10, 2021

Original:
image

Changed:
image

@Branikolog
Copy link
Collaborator

Hi, @a1exsh
Looks fantastic! :)
But I've noticed, that the original central button has its shadow (which is a part of image) merged with the frame darkening of the frame. Is it possible to get rid of bright line (between shadow and the frame darkening) here?
config shadow

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 10, 2021

@Branikolog good catch. I think we can fix that by extending the shadow by just one more pixel (currently it is -4,4).

@Branikolog
Copy link
Collaborator

@a1exsh
Also, it feels like shadow to the left contrasts more with the background, comparing to the same place near central button. Is it just due to another background texture?

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 10, 2021

@a1exsh Also, it feels like shadow to the left contrasts more with the background, comparing to the same place near central button. Is it just due to another background texture?

@Branikolog that is because the OKAY button and the shadow beneath it are part of the original resource, but we add shadow manually for our custom button, and it doesn't match 100%. Now that I think about it, in this case both buttons are of the same size, so what we can try is copying the original button together with the shadow instead.

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 10, 2021

Copied the shadow over from the OKAY button of the same dialog, it is now of the same darkness level:
Screenshot from 2021-10-10 16-55-35

@Branikolog
Copy link
Collaborator

@a1exsh
It's perfect!

@oleg-derevenetz oleg-derevenetz added bug Something doesn't work ui UI/GUI related stuff labels Oct 10, 2021
@oleg-derevenetz oleg-derevenetz added this to the 0.9.9 milestone Oct 10, 2021
@a1exsh a1exsh marked this pull request as draft October 12, 2021 15:19
@a1exsh a1exsh changed the title Add missing shadow from config button in game info dialog Add missing button shadows in dialogs Oct 12, 2021
@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 12, 2021

I'm extending the scope to include more buttons where shadows are missing, e.g. the battle summary dialog:
image
image

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 12, 2021

Experimental settings dialog:
image

Game config dialog:
Screenshot from 2021-10-12 18-09-08
image

@a1exsh a1exsh marked this pull request as ready for review October 12, 2021 16:49
@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 12, 2021

@Branikolog I've added missing shadows to all buttons that I have found. Maybe you would like to have a look ;)

@a1exsh
Copy link
Contributor Author

a1exsh commented Oct 12, 2021

Ah, there's also the battle-only dialog. Hide shadow from smaller the original EXIT button, center our button on screen, add shadow:
Screenshot from 2021-10-12 19-13-35

@a1exsh
Copy link
Contributor Author

a1exsh commented Nov 16, 2021

Hi, @a1exsh ! Found an issue with "Town Portal" buttons being pressed. image

If the issue you're referring to is with button corners — it is not new and I'm waiting for this PR to be merged before addressing these. I think it was discussed already in the comments here.

@Branikolog
Copy link
Collaborator

Sorry, @a1exsh. I have too much tasks now. :) Missed this moment.
I was just confused by the fact, the latest commit version doesn't have these corners.

@a1exsh
Copy link
Contributor Author

a1exsh commented Nov 16, 2021

@Branikolog

I was just confused by the fact, the latest commit version doesn't have these corners.

It may be, but the issue is definitely present in the latest release and it's not directly related to the shadows, so let's address it separately.

@a1exsh
Copy link
Contributor Author

a1exsh commented Nov 17, 2021

@ihhub please find the time to have a look — I've extracted the relevant code to new subclasses of the base button class.

Copy link
Owner

@ihhub ihhub left a 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 more comments in this pull request. Could you please take a look at them and check if they make sense, especially from architectural point of view?

Copy link
Owner

@ihhub ihhub left a comment

Choose a reason for hiding this comment

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

Hi @a1exsh , I put few more comments here. I feel we're almost there. Can you please check the comments?

@a1exsh
Copy link
Contributor Author

a1exsh commented Nov 23, 2021

@ihhub it complies and works, but I will not pretend I understood this std::move() magic 😅

@a1exsh a1exsh requested a review from ihhub November 26, 2021 15:15
Copy link
Owner

@ihhub ihhub left a 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 just few more optimization related comments. Could you please check them too?

@ihhub
Copy link
Owner

ihhub commented Nov 28, 2021

@ihhub it complies and works, but I will not pretend I understood this std::move() magic 😅

Move semantics are used to avoid memory copy and only for objects which are going to be destroyed just after the call. This is useful when you can just swap values instead of copy them. In case of images it's essential to avoid extensive memory manipulations.

@a1exsh
Copy link
Contributor Author

a1exsh commented Nov 28, 2021

Move semantics are used to avoid memory copy and only for objects which are going to be destroyed just after the call.

Well, that is clear. What I don't get is why in some places it's OK to just call new ButtonSprite( ... ) and in other places you have to specify std::move() explicitly...

@a1exsh a1exsh requested a review from ihhub November 28, 2021 11:39
@ihhub
Copy link
Owner

ihhub commented Nov 28, 2021

Well, that is clear. What I don't get is why in some places it's OK to just call new ButtonSprite( ... ) and in other places you have to specify std::move() explicitly...

std::move enforces in some sense to end object's lifetime within your code block. If you don't do this then you're passing by normal reference rather than by r-value.

@ihhub
Copy link
Owner

ihhub commented Nov 28, 2021

@Branikolog please retest the latest build again as we changed a lot of internal code.

@a1exsh
Copy link
Contributor Author

a1exsh commented Dec 2, 2021

appveyor build failed with an internal error, please re-trigger:

MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

@ihhub ihhub merged commit c9024a7 into ihhub:master Dec 3, 2021
@ihhub
Copy link
Owner

ihhub commented Dec 3, 2021

@a1exsh , a huge thanks for these changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants