Resume interrupted editor co-op runs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f87b59390e
commit
c7c3e979d6
24 files changed
+145
-6
No files matched your search
@@ -280,6 +280,7 @@ enum Btn {
|
||||
MatchCoopCreate,
|
||||
MatchCoopSource, // switch between the built-in campaign and the editor campaign
|
||||
MatchCoopSolo, // the selected co-op mission without the server, with an AI partner
|
||||
MatchCoopResume, // go on with the interrupted co-op run of the selected campaign
|
||||
MatchTake(usize),
|
||||
MatchAi(usize),
|
||||
MatchTeam(usize), // next team for that seat
|
||||
@@ -399,6 +400,7 @@ pub enum MenuAction {
|
||||
MatchCoopCreate(usize),
|
||||
MatchCoopEditorCreate(usize), // co-op match of a mission of `campaign_doc`
|
||||
MatchCoopSolo(Option<crate::campaign_doc::CampaignDoc>, usize), // offline with an AI partner: editor campaign or built-in, mission
|
||||
MatchCoopResume(crate::campaign_doc::CampaignDoc), // an interrupted run of this campaign goes on
|
||||
MatchTakeSide(u8),
|
||||
MatchSetAi(u8, bool),
|
||||
MatchSetTeam(u8, u8, bool), // side, team, the own seat
|
||||
@@ -800,6 +802,7 @@ impl Menu {
|
||||
self.confirm = None;
|
||||
MenuAction::Consumed
|
||||
}
|
||||
Some(Btn::MatchCoopResume) => MenuAction::MatchCoopResume(self.coop_doc().clone()),
|
||||
Some(Btn::MatchCoopSolo) if self.coop_editor => MenuAction::MatchCoopSolo(Some(self.coop_doc().clone()), self.coop_editor_mission),
|
||||
Some(Btn::MatchCoopSolo) => MenuAction::MatchCoopSolo(None, self.coop_mission),
|
||||
Some(Btn::MatchCoopCreate) if self.coop_editor => MenuAction::MatchCoopEditorCreate(self.coop_editor_mission),
|
||||
@@ -1998,6 +2001,12 @@ impl Menu {
|
||||
items.push((Btn::MatchCoopNext, ">".to_string()));
|
||||
items.push((Btn::MatchCoopSolo, tr("net.coop_solo")));
|
||||
}
|
||||
// an interrupted run of the shown campaign can go on (online, or offline with the AI)
|
||||
if editor_coop {
|
||||
if let Some((m, _, _)) = crate::coop_resume_of(&doc) {
|
||||
items.push((Btn::MatchCoopResume, trf("net.coop_resume", &[(m + 1).to_string()])));
|
||||
}
|
||||
}
|
||||
// the button names what comes next
|
||||
let next = match (editor_coop, self.coop_league) {
|
||||
(false, _) => "net.coop_league",
|
||||
|
||||
Reference in new issue
Block a user