Co-op offline with an AI partner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-05 21:04:49 +01:00
1 parent e3a9d32d61
commit f87b59390e
22 files changed
+272 -5

No files matched your search

+5
View File
@@ -279,6 +279,7 @@ enum Btn {
MatchCoopNext,
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
MatchTake(usize),
MatchAi(usize),
MatchTeam(usize), // next team for that seat
@@ -397,6 +398,7 @@ pub enum MenuAction {
MatchCreate,
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
MatchTakeSide(u8),
MatchSetAi(u8, bool),
MatchSetTeam(u8, u8, bool), // side, team, the own seat
@@ -798,6 +800,8 @@ impl Menu {
self.confirm = None;
MenuAction::Consumed
}
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),
Some(Btn::MatchCoopCreate) => MenuAction::MatchCoopCreate(self.coop_mission),
Some(Btn::MatchReady) => MenuAction::MatchReady(!self.match_ui.ready),
@@ -1992,6 +1996,7 @@ impl Menu {
items.push((Btn::MatchCoopPrev, "<".to_string()));
items.push((Btn::MatchCoopCreate, tr("net.coop_create")));
items.push((Btn::MatchCoopNext, ">".to_string()));
items.push((Btn::MatchCoopSolo, tr("net.coop_solo")));
}
// the button names what comes next
let next = match (editor_coop, self.coop_league) {