Editor texts (EN/DE), whole-campaign play and briefings for editor missions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-05 17:15:20 +01:00
1 parent 30dd8441b9
commit 985c34759d
6 files changed
+705 -14

No files matched your search

+9 -7
View File
@@ -43,6 +43,7 @@ pub enum EdAction {
None,
Close,
Test(usize),
Play, // the whole campaign from its first mission, following the branches
SaveFile,
OpenFile,
ServerSave,
@@ -280,31 +281,32 @@ impl Editor {
self.doc.language = langs[k].0.clone();
}
// buttons on the right
let labels = [tr("ed.new"), tr("ed.open"), tr("ed.save_file"), tr("ed.save_server"), tr("ed.close")];
let labels = [tr("ed.play"), tr("ed.new"), tr("ed.open"), tr("ed.save_file"), tr("ed.save_server"), tr("ed.close")];
let bw = labels.iter().map(|l| gfx.measure(l, S())).fold(0.0, f32::max) + CW() * 2.0;
let mut bx = w - CW() - bw;
for k in (0..labels.len()).rev() {
let r = Rect::new(bx, CH() * 0.6, bw, CH() * 1.7);
if im.button(gfx, r, &labels[k]) {
match k {
0 => {
0 => act = EdAction::Play,
1 => {
self.doc = CampaignDoc { name: tr("ed.new_campaign"), language: crate::i18n::language(), ..CampaignDoc::default() };
self.doc.add_mission();
self.server_id = None;
}
1 => {
2 => {
self.open_dialog = true;
act = EdAction::ServerRefresh;
}
2 => act = EdAction::SaveFile,
3 => act = EdAction::ServerSave,
3 => act = EdAction::SaveFile,
4 => act = EdAction::ServerSave,
_ => act = EdAction::Close,
}
}
bx -= bw + CW() * 0.5;
}
let mut publ = self.published;
if self.server_id.is_some() && im.toggle(gfx, w - CW() * 2.0 - bw * 3.0, CH() * 3.1, &tr("ed.published"), &mut publ) {
if self.server_id.is_some() && im.toggle(gfx, w - CW() * 2.0 - bw * 3.5, CH() * 3.1, &tr("ed.published"), &mut publ) {
self.published = publ;
act = EdAction::Publish(publ);
}
@@ -748,7 +750,7 @@ impl Editor {
(tr("ed.lava_rivers"), m.gen.lava.to_string(), 4),
(tr("ed.forts"), m.gen.forts.to_string(), 5),
(tr("ed.rivals"), m.gen.rivals.to_string(), 6),
(tr("ed.difficulty"), tr(["diff.easy", "diff.medium", "diff.hard"][m.gen.difficulty.min(2) as usize]), 7),
(tr("ed.difficulty"), tr(["diff.0", "diff.1", "diff.2"][m.gen.difficulty.min(2) as usize]), 7),
(tr("ed.portals"), m.portals.to_string(), 8),
];
if fixed {