fheroes2
fheroes2 copied to clipboard
adding hero button to wagon and other recruit objects
fheroes2 brings enhancement to dismiss troops while someone is recruiting, but it doesn't work everywhere.
before:
after:
related issue: #5249
Hi @shprotru!
The warnings have to do with the fact that you need to use the fheroes2::Text
specific functions/methods now that you are using that instead of class Text
.
Take this example from the warnings:
text.Blit( pos.x + 320 - text.w() / 2, pos.y + 64 );
fheroes2::Text
doesn't have a Blit
member function so you need to call its respective draw
function. In addition that function takes the additional parameter Image &
. You'll also notice that fheroes2::Text
has its width function named as width
instead of just w
. The same goes for h
and height
. Last but not least, the new fheroes2::Text
shifts the text up by 2 pixels compared to the old Text
which means we need to move down two pixels and therefore add 2 pixels in the Y position parameter. In the above example this gives us this change:
text.draw( pos.x + 320 - text.width() / 2, pos.y + 66, display );
Hi @shprotru , before proceeding with the review could you please explain why we need this feature if a player can easily hit a Space button one more time? I think we have similar discussion here.
Enhancements are good but we need to be cautious about them and not overuse them. I would say that in cases when a hero cannot repeat the same action they might help to improve user experience.
Let's do this way: we listen the opinion of @oleg-derevenetz , @Branikolog , @oleg-derevenetz , @zenseii and @idshibanov about this enhancement and then decide what we want to do.
Remember: look at this enhancement with closed eyes on similar buttons in other dialogs and question whether it is useful to have it.
Hi @ everyone in this PR 😅
I've been thinking a bit about this PR after @oleg-derevenetz's point that he made in another issue about adding the marketplace button. To summarize I believe we should only introduce such buttons to the dialogs if these dialogs cannot be exited and reentered again. Existing examples of these are level up, creature joining/"followers" etc.
That's why when it comes to the dialogs covered by this PR, which are the dwelling dialogs, I do not think we need the added button because the player can simply exit and reenter with the space bar after having made necessary changes (or just make them before entering).
Let's do this way: we listen the opinion of @oleg-derevenetz , @Branikolog , @oleg-derevenetz , @zenseii and @idshibanov about this enhancement and then decide what we want to do.
I believe that if the same action can be repeated later using spacebar, then there is no need to add a shortcut for it - it just clutters up the UI.
Hi, everyone.
In my personal point of view, we can add here this button, since this window 99% is the same to common joining window:
We can modify text here, as @zenseii proposed.
We can use a part of text from the next window, appearing after player accepts. Something like: "Your ranks are full, so you cannot join new troops"
and add it under the question. So, the next window (
You are unable to recruit at this time, your ranks are full.`) will never appear anymore.