fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Add missing generated small buttons and adjust some others

Open zenseii opened this issue 2 years ago • 7 comments

Add UNIFORM exit button for market place, add okay button for necromancy dialog at end of battle. Fix size of many buttons to fit smallest possible words for French.

zenseii avatar Dec 18 '22 09:12 zenseii

Hi @zenseii , how important this pull request to be in 1.0?

ihhub avatar Dec 18 '22 13:12 ihhub

Hi @zenseii , how important this pull request to be in 1.0?

It is second in line to this PR https://github.com/ihhub/fheroes2/pull/6394 which is much more important.

All buttons will not be possible to translate before 1.0 so this PR is just a step towards that.

zenseii avatar Dec 18 '22 14:12 zenseii

Hello, @zenseii What a pleasure to review such engine-changings PRs. :) Won't the button look better, if we shift text 1px to the left. I feel, like it's not centered, or am I wrong? image I think, dismiss, upgrade and large exit/okay buttons have the same shifting? Or is this just my tired eyes lying to me? :)

Branikolog avatar Dec 18 '22 21:12 Branikolog

Hello, @zenseii What a pleasure to review such engine-changings PRs. :) ? ! I think, dismiss, upgrade and large exit/okay buttons have the same shifting?

Hi @Branikolog. I looked at the TRADE button too and how to center it, but I wasn't able to figure out why the code wasn't centering it properly. As for the text that should be simple to do.

zenseii avatar Dec 18 '22 23:12 zenseii

Hi, @zenseii Oh, I actually was talking about the text. But I haven't noticed shifted button itself. :) I suppose, the button is alligned from the left window border, so being expanded, the button expanded to the right side only....

Branikolog avatar Dec 18 '22 23:12 Branikolog

Hi, @Branikolog.

I've fixed the alignment for the trade button now. The dismiss and upgrade etc. buttons are center-aligned. Dismiss has 14 pixels to the left of the button border and 15 pixels to the right.

zenseii avatar Dec 19 '22 03:12 zenseii

Hi, @zenseii Now buttons look properly aligned and texts seem to be placed in center of buttons. But many of expanded buttons have issues with background near the right edge. I think, we should fix it within current PR but later, after the 1.0 release.

Branikolog avatar Dec 19 '22 12:12 Branikolog

Hi, @Branikolog and @ihhub, are we still sure that we should address issues with shadow generation in this PR?

I can take a look at this although it is concerning different part of the code than what I did here, so maybe we should open a separate PR for that and then wait for that PR to finish before moving on with this one? What do you guys think?

zenseii avatar Dec 30 '22 12:12 zenseii

@zenseii If we merge this PR we'd have some sort of regression, regarding shadows of buttons. I know, that's not so essential, but I got used to the thing, that we're always going to only improve something in game. ) Edit: I'm ok with both solutions. The main thing is to fix everything till the next release. :)

Branikolog avatar Dec 30 '22 14:12 Branikolog

Hi @Branikolog , can you point which buttons have issues? I will take a look how to fix them.

ihhub avatar Dec 30 '22 14:12 ihhub

Hello, @ihhub

Hi @Branikolog , can you point which buttons have issues? I will take a look how to fix them.

I'm afraid, I won't be able to do that next two days. :) If you're not in hurry, I'll try to find all buttons up to 2nd January.

Branikolog avatar Dec 30 '22 14:12 Branikolog

Hi @Branikolog , can you point which buttons have issues? I will take a look how to fix them.

Hi, @ihhub. Thanks for looking into this. I would do it myself once I have a decent setup to more efficiently figure it out. This basically concerns all buttons that are generated within the createNormalButton() function, which means the non_uniform buttons, in other words anything that isn't UNIFORM_XYZ_BUTTON.

Examples are the creature recruit dialog MAX and MIN buttons, aka BUTTON_SMALL_MAX_GOOD, NON_UNIFORM_GOOD_MIN_BUTTON and BUTTON_SMALL_MIN_GOOD.

Really, this would be relevant for all buttons that are displayed on a non-uniform background, so even OKAY and CANCEL on things like the settings dialog, scenario info etc. The shadows need to be generated for these buttons that could be wider than the original, which could mean every single button on such backgrounds.

Incidentally this should solve the issue about missing shadows for the campaign information windows.

zenseii avatar Dec 30 '22 15:12 zenseii

Hi @zenseii , could you please rebased this branch from master and use the new standard window to solve the outstanding problems with buttons?

ihhub avatar Feb 18 '23 14:02 ihhub

@zenseii , big thanks for this improvement!

ihhub avatar Apr 10 '23 14:04 ihhub