Script blocks for weather and talent experience, groves as ground; the co-op campaign brings rogues and a storm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4e3158cc19
commit
eb219f6b01
23 files changed
+233
-8
No files matched your search
+21
-1
@@ -543,7 +543,13 @@ impl BlockEdit {
|
||||
let r = lay.take(CW() * 10.0);
|
||||
im.text_field(gfx, fid(path, 6), r, name, 16);
|
||||
}
|
||||
Block::Wave { count } | Block::Gold { amount: count } | Block::Mana { amount: count } => self.value(im, gfx, count, Ty::Num, path, 1, lay, ctx),
|
||||
Block::Wave { count } | Block::Gold { amount: count } | Block::Mana { amount: count } | Block::TalentXp { amount: count } => self.value(im, gfx, count, Ty::Num, path, 1, lay, ctx),
|
||||
Block::Weather { kind, secs } => {
|
||||
weather_dd(im, gfx, kind, fid(path, 2), lay);
|
||||
lay.word(gfx, &tr("blk.w_for"));
|
||||
self.value(im, gfx, secs, Ty::Num, path, 1, lay, ctx);
|
||||
lay.word(gfx, &tr("blk.w_seconds"));
|
||||
}
|
||||
Block::SetVar { name, value } | Block::AddVar { name, value } => {
|
||||
let r = lay.take(CW() * 12.0);
|
||||
im.text_field(gfx, fid(path, 0), r, name, 24);
|
||||
@@ -713,10 +719,24 @@ impl BlockEdit {
|
||||
lay.word(gfx, &tr("blk.v.eventkind"));
|
||||
self.kind_dd(im, gfx, kind, false, path, sub(0), lay);
|
||||
}
|
||||
Val::WeatherIs { kind } => {
|
||||
lay.word(gfx, &tr("blk.v.weatheris"));
|
||||
weather_dd(im, gfx, kind, fid(path, sub(0)), lay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// a dropdown with the kinds of weather
|
||||
fn weather_dd(im: &mut Im, gfx: &Gfx, kind: &mut String, id: u64, lay: &mut Lay) {
|
||||
let opts: Vec<String> = WEATHER.iter().map(|w| tr(&format!("weather.{}", w))).collect();
|
||||
let cur = tr(&format!("weather.{}", kind));
|
||||
let r = lay.take(CW() * 12.0);
|
||||
if let Some(c) = im.dropdown(gfx, id, r, &cur, &opts) {
|
||||
*kind = WEATHER[c].to_string();
|
||||
}
|
||||
}
|
||||
|
||||
// where the next field of a block goes: left to right, into a new row at the block's edge
|
||||
struct Lay {
|
||||
x: f32,
|
||||
|
||||
Reference in new issue
Block a user