adding hero button to wagon and other recruit objects#5507
adding hero button to wagon and other recruit objects#5507shprotru wants to merge 12 commits intoihhub:masterfrom
Conversation
|
Hi @shprotru! The warnings have to do with the fact that you need to use the Take this example from the warnings: text.Blit( pos.x + 320 - text.w() / 2, pos.y + 64 );
text.draw( pos.x + 320 - text.width() / 2, pos.y + 66, display ); |
There was a problem hiding this comment.
Hi @shprotru !
I just tested this and would it be possible to add this for dwellings that give you creatures for free too? Like the Peasant hut, fearie trees etc. ?

Also we have a slightly similar issue regarding creatures that join you due to alliances like dwarves and dragons. This would require a bit more work though since some extra dialog logic needs to be added if you read the discussion in that issue #5249 .
If you want to go ahead and add that too but need some clarification then don't hesitate to ask either me or the other members that contributed to that issue's discussion.
| if ( Dialog::YES == Dialog::Message( title, message, Font::BIG, Dialog::YES | Dialog::NO ) ) { | ||
| if ( Dialog::YES == Dialog::ArmyJoinFree( title, message, troop, hero ) ) { | ||
| if ( !hero.GetArmy().CanJoinTroop( troop ) ) | ||
| Dialog::Message( troop.GetName(), _( "You are unable to recruit at this time, your ranks are full." ), Font::BIG, Dialog::OK ); |
| AudioManager::PlaySound( M82::EXPERNCE ); | ||
|
|
||
| if ( Dialog::YES == Dialog::ArmyJoinFree( title, message, troop, hero ) ) { | ||
| if ( Dialog::YES == Dialog::Message( title, message, Font::BIG, Dialog::YES | Dialog::NO ) ) { |
There was a problem hiding this comment.
I didn't ask if you could revert this change, but the logic needs to reflect that the message will not appear anymore.
The code I'm asking for would be something like this.
if ( Dialog::YES == Dialog::ArmyJoinFree( title, message, troop, hero ) ) {
tile.MonsterSetCount( 0 );
hero.GetArmy().JoinTroop( troop );
hero.MovePointsScaleFixed();
Interface::Basic::Get().GetStatusWindow().SetRedraw();
}What do you think?
|
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). |
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: |
|
Guys, could you please just merge it as is? |


fheroes2 brings enhancement to dismiss troops while someone is recruiting, but it doesn't work everywhere.
before:

after:

related issue: #5249