-
-
Notifications
You must be signed in to change notification settings - Fork 448
adding hero button to wagon and other recruit objects #5507
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
Open
shprotru
wants to merge
12
commits into
ihhub:master
Choose a base branch
from
shprotru:wagon_army_join
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
625a992
wagon and other recruit objects hero button
42e814a
code formatting
ff2ff6d
more consts, more references
310bf05
code formatting
45d6524
Merge remote-tracking branch 'upstream/master' into wagon_army_join
e5c07c2
attemt to use ui_text
6f67ba3
resolved code format problem
8f3189f
resolved conversation problems
52fc06b
code formatting
fed7d7a
ActionToDwellingJoinMonster dialog updated with ArmyJoinFree
2e5dbe5
ActionToDwellingJoinMonster dialog updated with ArmyJoinFree
01ac5e9
returned back ActionToDwellingJoinMonster
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -612,7 +612,12 @@ void ActionToMonster( Heroes & hero, int32_t dst_index ) | |
| else if ( join.reason == NeutralMonsterJoiningCondition::Reason::Free ) { | ||
| DEBUG_LOG( DBG_GAME, DBG_INFO, hero.GetName() << " join monster " << troop.GetName() ) | ||
|
|
||
| if ( Dialog::YES == Dialog::ArmyJoinFree( troop, hero ) ) { | ||
| const fheroes2::Text header( _( "Followers" ), fheroes2::FontType::normalYellow() ); | ||
| std::string message = _( "A group of %{monster} with a desire for greater glory wish to join you.\nDo you accept?" ); | ||
| StringReplace( message, "%{monster}", Translation::StringLower( troop.GetMultiName() ) ); | ||
| const fheroes2::Text body( message, fheroes2::FontType::normalWhite() ); | ||
|
|
||
| if ( Dialog::YES == Dialog::ArmyJoinFree( header.text(), body.text(), troop, hero ) ) { | ||
| hero.GetArmy().JoinTroop( troop ); | ||
|
|
||
| I.GetStatusWindow().SetRedraw(); | ||
|
|
@@ -2214,7 +2219,7 @@ void ActionToDwellingJoinMonster( Heroes & hero, const MP2::MapObjectType object | |
|
|
||
| AudioManager::PlaySound( M82::EXPERNCE ); | ||
|
|
||
| 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 ) ) | ||
|
shprotru marked this conversation as resolved.
|
||
| Dialog::Message( troop.GetName(), _( "You are unable to recruit at this time, your ranks are full." ), Font::BIG, Dialog::OK ); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| else { | ||
|
|
@@ -2303,7 +2308,7 @@ void ActionToDwellingRecruitMonster( Heroes & hero, const MP2::MapObjectType obj | |
|
|
||
| if ( !troop.isValid() ) | ||
| Dialog::Message( title, msg_void, Font::BIG, Dialog::OK ); | ||
| else if ( Dialog::YES == Dialog::Message( title, msg_full, Font::BIG, Dialog::YES | Dialog::NO ) ) | ||
| else if ( Dialog::YES == Dialog::ArmyJoinFree( title, msg_full, troop, hero ) ) | ||
| RecruitMonsterFromTile( hero, tile, title, troop, false ); | ||
|
|
||
| hero.SetVisited( dst_index, Visit::GLOBAL ); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.