Holiday switch in the debug menu; darker wood for the treasury chests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f670554c7
commit
4175ca7f97
24 files changed
+112
-8
No files matched your search
@@ -389,6 +389,10 @@ set.debug_ping = Zobrazit ping
|
||||
set.debug_trigger_zones = Zobrazit zóny spouštěčů
|
||||
set.debug_command_markers = Zobrazit ladicí značky rozkazů
|
||||
set.debug_path_lines = Zobrazit čáry cest
|
||||
set.debug_holiday = Svátek
|
||||
val.halloween = Halloween
|
||||
val.christmas = Vánoce
|
||||
val.easter = Velikonoce
|
||||
|
||||
hint.pickup_prisoner_where = Zajatce lze zvednout jen na vlastním území.
|
||||
hint.punch_where = Ruka může bít hrdiny jen na tvém vlastním území.
|
||||
|
||||
@@ -388,6 +388,10 @@ set.debug_ping = Vis ping
|
||||
set.debug_trigger_zones = Vis udløserzoner
|
||||
set.debug_command_markers = Vis debug-ordremarkører
|
||||
set.debug_path_lines = Vis stilinjer
|
||||
set.debug_holiday = Højtid
|
||||
val.halloween = Halloween
|
||||
val.christmas = Jul
|
||||
val.easter = Påske
|
||||
|
||||
hint.pickup_prisoner_where = Fanger kan kun samles op på dit eget område.
|
||||
hint.punch_where = Hånden kan kun slå helte på dit eget område.
|
||||
|
||||
@@ -388,6 +388,10 @@ set.debug_ping = Ping anzeigen
|
||||
set.debug_trigger_zones = Triggerzonen anzeigen
|
||||
set.debug_command_markers = Debug-Befehlsmarker anzeigen
|
||||
set.debug_path_lines = Pfadlinien anzeigen
|
||||
set.debug_holiday = Festzeit
|
||||
val.halloween = Halloween
|
||||
val.christmas = Weihnachten
|
||||
val.easter = Ostern
|
||||
|
||||
hint.pickup_prisoner_where = Gefangene können nur auf eigenem Gebiet aufgehoben werden.
|
||||
hint.punch_where = Die Hand kann Helden nur auf eigenem Gebiet schlagen.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Εμφάνιση ping
|
||||
set.debug_trigger_zones = Εμφάνιση ζωνών ενεργοποίησης
|
||||
set.debug_command_markers = Εμφάνιση δεικτών εντολών debug
|
||||
set.debug_path_lines = Εμφάνιση γραμμών διαδρομής
|
||||
set.debug_holiday = Γιορτή
|
||||
val.halloween = Halloween
|
||||
val.christmas = Χριστούγεννα
|
||||
val.easter = Πάσχα
|
||||
|
||||
hint.pickup_prisoner_where = Αιχμάλωτοι σηκώνονται μόνο στη δική σου επικράτεια.
|
||||
hint.punch_where = Το χέρι χτυπά ήρωες μόνο στη δική σου επικράτεια.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Show ping
|
||||
set.debug_trigger_zones = Show trigger zones
|
||||
set.debug_command_markers = Show debug command markers
|
||||
set.debug_path_lines = Show path lines
|
||||
set.debug_holiday = Holiday
|
||||
val.halloween = Halloween
|
||||
val.christmas = Christmas
|
||||
val.easter = Easter
|
||||
|
||||
hint.pickup_prisoner_where = Prisoners can only be picked up on your own territory.
|
||||
hint.punch_where = The hand can only punch heroes on your own territory.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Mostrar ping
|
||||
set.debug_trigger_zones = Mostrar zonas de activación
|
||||
set.debug_command_markers = Mostrar marcadores de órdenes
|
||||
set.debug_path_lines = Mostrar líneas de ruta
|
||||
set.debug_holiday = Festividad
|
||||
val.halloween = Halloween
|
||||
val.christmas = Navidad
|
||||
val.easter = Pascua
|
||||
|
||||
hint.pickup_prisoner_where = Los prisioneros solo pueden recogerse en tu propio territorio.
|
||||
hint.punch_where = La mano solo puede golpear a héroes en tu propio territorio.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Näytä ping
|
||||
set.debug_trigger_zones = Näytä laukaisualueet
|
||||
set.debug_command_markers = Näytä komentomerkit
|
||||
set.debug_path_lines = Näytä reittiviivat
|
||||
set.debug_holiday = Juhlakausi
|
||||
val.halloween = Halloween
|
||||
val.christmas = Joulu
|
||||
val.easter = Pääsiäinen
|
||||
|
||||
hint.pickup_prisoner_where = Vankeja voi nostaa vain omalta alueeltasi.
|
||||
hint.punch_where = Käsi voi mukiloida sankareita vain omalla alueellasi.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Prikaži ping
|
||||
set.debug_trigger_zones = Prikaži zone okidača
|
||||
set.debug_command_markers = Prikaži debug oznake naredbi
|
||||
set.debug_path_lines = Prikaži linije putanja
|
||||
set.debug_holiday = Blagdan
|
||||
val.halloween = Halloween
|
||||
val.christmas = Božić
|
||||
val.easter = Uskrs
|
||||
|
||||
hint.pickup_prisoner_where = Zarobljenici se mogu podići samo na tvom teritoriju.
|
||||
hint.punch_where = Ruka može udarati junake samo na tvom teritoriju.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Ping mutatása
|
||||
set.debug_trigger_zones = Indítózónák mutatása
|
||||
set.debug_command_markers = Debug parancsjelölők mutatása
|
||||
set.debug_path_lines = Útvonalak mutatása
|
||||
set.debug_holiday = Ünnep
|
||||
val.halloween = Halloween
|
||||
val.christmas = Karácsony
|
||||
val.easter = Húsvét
|
||||
|
||||
hint.pickup_prisoner_where = Foglyot csak a saját területeden vehetsz fel.
|
||||
hint.punch_where = A kéz csak a saját területeden üthet meg hősöket.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Mostra ping
|
||||
set.debug_trigger_zones = Mostra zone trigger
|
||||
set.debug_command_markers = Mostra marcatori comandi
|
||||
set.debug_path_lines = Mostra percorsi
|
||||
set.debug_holiday = Festività
|
||||
val.halloween = Halloween
|
||||
val.christmas = Natale
|
||||
val.easter = Pasqua
|
||||
|
||||
hint.pickup_prisoner_where = I prigionieri si raccolgono solo sul tuo territorio.
|
||||
hint.punch_where = La mano può prendere a pugni gli eroi solo sul tuo territorio.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Ping tonen
|
||||
set.debug_trigger_zones = Triggerzones tonen
|
||||
set.debug_command_markers = Debug-commandomarkeringen tonen
|
||||
set.debug_path_lines = Padlijnen tonen
|
||||
set.debug_holiday = Feestdag
|
||||
val.halloween = Halloween
|
||||
val.christmas = Kerstmis
|
||||
val.easter = Pasen
|
||||
|
||||
hint.pickup_prisoner_where = Gevangenen kun je alleen op je eigen gebied oppakken.
|
||||
hint.punch_where = De hand kan helden alleen op je eigen gebied slaan.
|
||||
|
||||
@@ -388,6 +388,10 @@ set.debug_ping = Vis ping
|
||||
set.debug_trigger_zones = Vis utløsersoner
|
||||
set.debug_command_markers = Vis debug-ordremarkører
|
||||
set.debug_path_lines = Vis stilinjer
|
||||
set.debug_holiday = Høytid
|
||||
val.halloween = Halloween
|
||||
val.christmas = Jul
|
||||
val.easter = Påske
|
||||
|
||||
hint.pickup_prisoner_where = Fanger kan bare plukkes opp på ditt eget område.
|
||||
hint.punch_where = Hånden kan bare slå helter på ditt eget område.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Mostrar ping
|
||||
set.debug_trigger_zones = Mostrar zonas de ativação
|
||||
set.debug_command_markers = Mostrar marcadores de comando
|
||||
set.debug_path_lines = Mostrar linhas de caminho
|
||||
set.debug_holiday = Festividade
|
||||
val.halloween = Halloween
|
||||
val.christmas = Natal
|
||||
val.easter = Páscoa
|
||||
|
||||
hint.pickup_prisoner_where = Só podes apanhar prisioneiros no teu próprio território.
|
||||
hint.punch_where = A mão só pode socar heróis no teu próprio território.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Arată ping
|
||||
set.debug_trigger_zones = Arată zonele declanșatoare
|
||||
set.debug_command_markers = Arată marcajele de comenzi (depanare)
|
||||
set.debug_path_lines = Arată liniile de traseu
|
||||
set.debug_holiday = Sărbătoare
|
||||
val.halloween = Halloween
|
||||
val.christmas = Crăciun
|
||||
val.easter = Paște
|
||||
|
||||
hint.pickup_prisoner_where = Prizonierii pot fi ridicați doar pe teritoriul tău.
|
||||
hint.punch_where = Mâna poate lovi eroii doar pe teritoriul tău.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Показывать пинг
|
||||
set.debug_trigger_zones = Зоны триггеров
|
||||
set.debug_command_markers = Маркеры отладочных команд
|
||||
set.debug_path_lines = Линии путей
|
||||
set.debug_holiday = Праздник
|
||||
val.halloween = Хэллоуин
|
||||
val.christmas = Рождество
|
||||
val.easter = Пасха
|
||||
|
||||
hint.pickup_prisoner_where = Пленников можно поднимать только на своей территории.
|
||||
hint.punch_where = Рука бьёт героев только на твоей территории.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Zobraziť ping
|
||||
set.debug_trigger_zones = Zobraziť zóny spúšťačov
|
||||
set.debug_command_markers = Zobraziť ladiace značky rozkazov
|
||||
set.debug_path_lines = Zobraziť čiary ciest
|
||||
set.debug_holiday = Sviatok
|
||||
val.halloween = Halloween
|
||||
val.christmas = Vianoce
|
||||
val.easter = Veľká noc
|
||||
|
||||
hint.pickup_prisoner_where = Zajatcov možno zdvihnúť len na vlastnom území.
|
||||
hint.punch_where = Ruka môže biť hrdinov len na tvojom vlastnom území.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Прикажи пинг
|
||||
set.debug_trigger_zones = Прикажи зоне окидача
|
||||
set.debug_command_markers = Прикажи дебаг ознаке наредби
|
||||
set.debug_path_lines = Прикажи линије путања
|
||||
set.debug_holiday = Празник
|
||||
val.halloween = Ноћ вештица
|
||||
val.christmas = Божић
|
||||
val.easter = Ускрс
|
||||
|
||||
hint.pickup_prisoner_where = Заробљеници могу да се подигну само на твојој територији.
|
||||
hint.punch_where = Рука може да удара хероје само на твојој територији.
|
||||
|
||||
@@ -389,6 +389,10 @@ set.debug_ping = Visa ping
|
||||
set.debug_trigger_zones = Visa triggerzoner
|
||||
set.debug_command_markers = Visa debug-ordermarkörer
|
||||
set.debug_path_lines = Visa stiglinjer
|
||||
set.debug_holiday = Högtid
|
||||
val.halloween = Halloween
|
||||
val.christmas = Jul
|
||||
val.easter = Påsk
|
||||
|
||||
hint.pickup_prisoner_where = Fångar kan bara plockas upp på ditt eget territorium.
|
||||
hint.punch_where = Handen kan bara slå hjältar på ditt eget territorium.
|
||||
|
||||
+17
-2
@@ -53,12 +53,27 @@ pub fn holiday_on(y: i64, m: i64, d: i64) -> u8 {
|
||||
}
|
||||
}
|
||||
|
||||
// today's holiday (worked out once); on the desktop DUNGEONCRAFT_HOLIDAY=halloween / christmas /
|
||||
// easter / none shows one at any time
|
||||
thread_local! {
|
||||
// the debug menu's choice: 0 by the date, else the holiday + 1
|
||||
static OVERRIDE: std::cell::Cell<u8> = const { std::cell::Cell::new(0) };
|
||||
}
|
||||
|
||||
// the debug menu's holiday setting (Settings::debug_holiday: 0 by the date, 1 none, 2 Halloween,
|
||||
// 3 Christmas, 4 Easter)
|
||||
pub fn set_override(v: u8) {
|
||||
OVERRIDE.with(|o| o.set(v.min(4)));
|
||||
}
|
||||
|
||||
// today's holiday (worked out once) unless the debug menu picks one; on the desktop
|
||||
// DUNGEONCRAFT_HOLIDAY=halloween / christmas / easter / none shows one at any time
|
||||
pub fn current() -> u8 {
|
||||
thread_local! {
|
||||
static HOLIDAY: std::cell::Cell<u8> = const { std::cell::Cell::new(255) };
|
||||
}
|
||||
let forced = OVERRIDE.with(|o| o.get());
|
||||
if forced > 0 {
|
||||
return forced - 1;
|
||||
}
|
||||
HOLIDAY.with(|h| {
|
||||
if h.get() == 255 {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
@@ -480,6 +480,7 @@ fn apply_settings(s: &Settings, r3d: &mut R3d) {
|
||||
r3d.set_wall_detail(s.wall_subdivisions());
|
||||
r3d.max_lights = s.max_lights as usize;
|
||||
r3d.pixel_rows = settings::pixel_rows(s.pixel_rows);
|
||||
holiday::set_override(s.debug_holiday);
|
||||
audio::set_volumes(s.music_volume, s.volume, s.muted);
|
||||
}
|
||||
|
||||
|
||||
+11
-1
@@ -62,6 +62,7 @@ pub enum Item {
|
||||
DebugTriggerZones,
|
||||
DebugCommandMarkers,
|
||||
DebugPathLines,
|
||||
DebugHoliday,
|
||||
GameSpeed,
|
||||
Hints,
|
||||
Events,
|
||||
@@ -77,7 +78,7 @@ fn tab_items(tab: usize) -> &'static [Item] {
|
||||
1 => &[RotateSpeed, PanSpeed, ZoomSpeed, EdgeScroll, InvertMouse],
|
||||
2 => &[Outlines, WallDetail, Lights, UiScale, RenderScale],
|
||||
3 => &[GameSpeed, Hints, Events, TouchUi],
|
||||
4 => &[DebugFps, DebugFrameTime, DebugPing, DebugTriggerZones, DebugCommandMarkers, DebugPathLines],
|
||||
4 => &[DebugFps, DebugFrameTime, DebugPing, DebugTriggerZones, DebugCommandMarkers, DebugPathLines, DebugHoliday],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
@@ -104,6 +105,7 @@ fn item_label(it: Item) -> String {
|
||||
Item::DebugTriggerZones => "set.debug_trigger_zones",
|
||||
Item::DebugCommandMarkers => "set.debug_command_markers",
|
||||
Item::DebugPathLines => "set.debug_path_lines",
|
||||
Item::DebugHoliday => "set.debug_holiday",
|
||||
Item::GameSpeed => "set.game_speed",
|
||||
Item::Hints => "set.hints",
|
||||
Item::Events => "set.events",
|
||||
@@ -151,6 +153,13 @@ fn item_value(it: Item, s: &Settings) -> String {
|
||||
Item::DebugTriggerZones => onoff(s.debug_trigger_zones),
|
||||
Item::DebugCommandMarkers => onoff(s.debug_command_markers),
|
||||
Item::DebugPathLines => onoff(s.debug_path_lines),
|
||||
Item::DebugHoliday => tr(match s.debug_holiday {
|
||||
1 => "val.off",
|
||||
2 => "val.halloween",
|
||||
3 => "val.christmas",
|
||||
4 => "val.easter",
|
||||
_ => "val.auto_plain",
|
||||
}),
|
||||
Item::RenderScale => tr(if crate::settings::pixel_rows(s.pixel_rows) == crate::settings::HIGH_RES_ROWS as u32 { "set.style_highres" } else { "set.style_pixel" }),
|
||||
Item::GameSpeed => format!("{}x", s.game_speed as i32),
|
||||
Item::Hints => onoff(s.hints),
|
||||
@@ -207,6 +216,7 @@ fn item_change(it: Item, s: &mut Settings, d: i32) {
|
||||
Item::DebugTriggerZones => s.debug_trigger_zones = !s.debug_trigger_zones,
|
||||
Item::DebugCommandMarkers => s.debug_command_markers = !s.debug_command_markers,
|
||||
Item::DebugPathLines => s.debug_path_lines = !s.debug_path_lines,
|
||||
Item::DebugHoliday => s.debug_holiday = cycle(&[0u8, 1, 2, 3, 4], s.debug_holiday.min(4), d),
|
||||
Item::GameSpeed => s.game_speed = cycle(&[1.0f32, 2.0], s.game_speed, d),
|
||||
Item::Hints => s.hints = !s.hints,
|
||||
Item::Events => s.events = !s.events,
|
||||
|
||||
+2
-2
@@ -430,8 +430,8 @@ fn chest(c: Vec3, h: u32, l: f32, fill: f32, res: u8) {
|
||||
let at = |dx: f32, dz: f32, y: f32| c + vec3(dx * ca - dz * sa, y, dx * sa + dz * ca);
|
||||
let cube = |p: Vec3, s: Vec3, col: Color| cube(p, if q % 2 == 1 { vec3(s.z, s.y, s.x) } else { s }, col);
|
||||
let mcube = |m: Mat, p: Vec3, s: Vec3, col: Color| mc(m, p, if q % 2 == 1 { vec3(s.z, s.y, s.x) } else { s }, col);
|
||||
let wood = rgb(110, 70, 36, l);
|
||||
let band = rgb(170, 140, 70, l);
|
||||
let wood = rgb(66, 40, 22, l);
|
||||
let band = rgb(150, 122, 60, l);
|
||||
mcube(Mat::Wood, at(0.0, 0.0, 0.16), vec3(0.56, 0.32, 0.4), wood);
|
||||
mcube(Mat::Iron, at(0.0, 0.0, 0.16), vec3(0.58, 0.05, 0.42), band);
|
||||
mcube(Mat::Iron, at(0.0, 0.21, 0.18), vec3(0.08, 0.1, 0.02), band);
|
||||
|
||||
+7
-3
@@ -1255,6 +1255,7 @@ pub struct R3d {
|
||||
target: Option<(RenderTarget, u32, u32)>, // low resolution render target
|
||||
lava: Vec<f32>, // lava light per tile (see lava_field)
|
||||
chunks_hd: bool, // the chunks were built with the high-res atlas
|
||||
chunks_holiday: u8, // ... and with this holiday's decorations
|
||||
}
|
||||
|
||||
// The 3D resolution setting refers to a window 1080 device pixels high: smaller windows use a
|
||||
@@ -1305,7 +1306,7 @@ fn chunk_sig(map: &Map, cx: i32, cz: i32) -> u64 {
|
||||
|
||||
impl R3d {
|
||||
pub fn new() -> R3d {
|
||||
R3d { lit: lit_material(), glow: glow_material(), opaque: opaque_material(), chunks: Vec::new(), ncx: 0, ncz: 0, outlines: true, wall_sub: 3, max_lights: MAX_LIGHTS, pixel_rows: crate::settings::PIXEL_ART_ROWS as u32, target: None, lava: Vec::new(), chunks_hd: false }
|
||||
R3d { lit: lit_material(), glow: glow_material(), opaque: opaque_material(), chunks: Vec::new(), ncx: 0, ncz: 0, outlines: true, wall_sub: 3, max_lights: MAX_LIGHTS, pixel_rows: crate::settings::PIXEL_ART_ROWS as u32, target: None, lava: Vec::new(), chunks_hd: false, chunks_holiday: 0 }
|
||||
}
|
||||
|
||||
// Changing the wall detail rebuilds all chunks
|
||||
@@ -1345,10 +1346,13 @@ impl R3d {
|
||||
ch.sig = 0;
|
||||
}
|
||||
}
|
||||
// the graphics style changed: the chunks are built again with the other atlas
|
||||
// the graphics style or the holiday changed: the chunks are built again (other atlas,
|
||||
// other decorations)
|
||||
let hd = self.pixel_rows >= crate::settings::HIGH_RES_ROWS as u32;
|
||||
if hd != self.chunks_hd {
|
||||
let holiday = crate::holiday::current();
|
||||
if hd != self.chunks_hd || holiday != self.chunks_holiday {
|
||||
self.chunks_hd = hd;
|
||||
self.chunks_holiday = holiday;
|
||||
for ch in self.chunks.iter_mut() {
|
||||
ch.sig = 0;
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ pub struct Settings {
|
||||
pub debug_trigger_zones: bool, // draw mission trigger zones
|
||||
pub debug_command_markers: bool, // draw extra command markers (guard/attack/gather stay fixed)
|
||||
pub debug_path_lines: bool, // draw creature path lines
|
||||
pub debug_holiday: u8, // holiday: 0 by the date, 1 none, 2 Halloween, 3 Christmas, 4 Easter
|
||||
// game
|
||||
pub game_speed: f32, // 1 or 2
|
||||
pub hints: bool,
|
||||
@@ -200,6 +201,7 @@ impl Default for Settings {
|
||||
debug_trigger_zones: false,
|
||||
debug_command_markers: false,
|
||||
debug_path_lines: false,
|
||||
debug_holiday: 0,
|
||||
game_speed: 1.0,
|
||||
hints: true,
|
||||
difficulty: 1,
|
||||
|
||||
Reference in new issue
Block a user