Skip to content

Allow to restart campaign scenario from File Options dialog - #10637

Draft
ihhub wants to merge 4 commits into
masterfrom
restart-game-campaign
Draft

ihhub wants to merge 4 commits into
masterfrom
restart-game-campaign

Conversation

@ihhub

@ihhub ihhub commented Apr 3, 2026

Copy link
Copy Markdown
Owner

relates to #1528

@ihhub ihhub added this to the 1.1.15 milestone Apr 3, 2026
@ihhub ihhub self-assigned this Apr 3, 2026
@ihhub ihhub added improvement New feature, request or improvement logic Things related to game logic labels Apr 3, 2026
@ihhub
ihhub marked this pull request as draft April 3, 2026 09:40

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

Comment thread src/fheroes2/dialog/dialog_file.cpp Outdated
Comment thread src/fheroes2/dialog/dialog_file.cpp Outdated
Comment thread src/fheroes2/dialog/dialog_file.cpp Outdated
Comment thread src/fheroes2/dialog/dialog_file.cpp Outdated
@sonarqubecloud

sonarqubecloud Bot commented Apr 3, 2026

Copy link
Copy Markdown

@ihhub
ihhub marked this pull request as ready for review April 3, 2026 13:31
@ihhub
ihhub requested a review from Districh-ru April 3, 2026 13:31

@Districh-ru Districh-ru left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @ihhub, I tester some SW and PoL campaigns and found one rendering bug to and add one check or assertion. Could you please check the comments I left in your spare time?

const Campaign::ScenarioInfoId & currentScenarioInfoId = campaignSaveData.getCurrentScenarioInfoId();
const std::vector<Campaign::ScenarioData> & scenarios = campaignData.getAllScenarios();
const Campaign::ScenarioData & scenario = scenarios[currentScenarioInfoId.scenarioId];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we check (or assert) scenarios.size() > currentScenarioInfoId.scenarioId?

}

// Fade-out screen before loading a scenario.
fheroes2::fadeOutDisplay();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When I restart scenario from the File dialog two fade-outs occur:

fheroes2.2026-04-04.21-16-13-957.mp4

We can pass const bool needDisplayFadeOut to execute this line only when starting a new game but not restarting from the adventure map because the adventure map also fades out when we leave it.
Or (possibly a better solution) - update the condition in game_startgame.cpp line 966: if ( res != fheroes2::GameMode::HIGHSCORES_STANDARD && res != fheroes2::GameMode::START_GAME) {

break;
}

// TODO: restart the campaign here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove this comment now.

@ihhub
ihhub marked this pull request as draft April 5, 2026 03:29
@ihhub ihhub modified the milestones: 1.1.15, 1.2.0 Apr 12, 2026
@ihhub ihhub modified the milestones: 1.2.0, 1.1.16 Apr 30, 2026
@ihhub ihhub modified the milestones: 1.1.16, 1.1.17 May 17, 2026
@ihhub ihhub modified the milestones: 1.1.17, 1.1.18 Jun 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement New feature, request or improvement logic Things related to game logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants