From bf85f62dcaa1dd653f3abd81323e880994dc139d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1=C4=8Dek?= Date: Tue, 13 Oct 2026 22:52:54 +0200 Subject: [PATCH] Raise the configurable roadblock limit to 30 Align runtime validation, settings import, admin UI, help and documentation. Update boundary regression coverage; keep the default at four. --- addons/core/Scripts/Game/ERR/00_Core/ERR_AdminService.c | 2 +- addons/core/Scripts/Game/ERR/00_Core/ERR_Settings.c | 2 +- addons/core/UI/layouts/ERR/AdminMenu.layout | 2 +- docs/configuration.md | 2 +- tests/test_roadblocks.py | 2 +- tools/import_settings.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/core/Scripts/Game/ERR/00_Core/ERR_AdminService.c b/addons/core/Scripts/Game/ERR/00_Core/ERR_AdminService.c index 4c8e0f4..5a612f3 100644 --- a/addons/core/Scripts/Game/ERR/00_Core/ERR_AdminService.c +++ b/addons/core/Scripts/Game/ERR/00_Core/ERR_AdminService.c @@ -178,7 +178,7 @@ class ERR_AdminService if (key == "objectGuardHQMode") return "0: all hold their posts; 1: half hold, half respond to HQ; 2: all may respond to HQ. All report contacts. Next round."; if (key == "objectGuardCount") return "0..16 soldiers per factory/industrial, military or infrastructure site; default 8, zero off. Next round. HQ participation is configured separately; all report. Towers and chimneys use suitable platforms. Lost guards are not replaced."; if (key == "hunterSpawnDistanceMetres") return "Opening UAZ and troop-truck patrol placement. Applies next round."; - if (key == "roadblockCount") return "Set 0..12 roadblocks (default 4; 0 disables). Applies next round. Each has four guards; unsuitable sites are skipped."; + if (key == "roadblockCount") return "Set 0..30 roadblocks (default 4; 0 disables). Applies next round. Each has four guards; unsuitable sites are skipped."; if (key == "civilianTrafficCount") return "Set 0..6 civilian cars (default 3). Zero disables new traffic. Unclaimed cars retire only far from all players and out of sight; player-entered cars are preserved."; if (key == "keepWeaponOnUnconscious") return "Set 1 to retain the held firearm during unconsciousness and equip it after recovery; 0 keeps normal dropping. Applies to the next knockout."; if (key == "antiAirChancePercent" || key == "antiPersonnelMineChancePercent") diff --git a/addons/core/Scripts/Game/ERR/00_Core/ERR_Settings.c b/addons/core/Scripts/Game/ERR/00_Core/ERR_Settings.c index f8847fb..a84f22f 100644 --- a/addons/core/Scripts/Game/ERR/00_Core/ERR_Settings.c +++ b/addons/core/Scripts/Game/ERR/00_Core/ERR_Settings.c @@ -28,7 +28,7 @@ class ERR_Settings if (key == "objectGuardHQMode") return value >= 0 && value <= 2; if (key == "objectGuardCount") return value >= 0 && value <= 16; if (key == "hunterSpawnDistanceMetres") return value >= 800 && value <= 3000; - if (key == "roadblockCount") return value >= 0 && value <= 12; + if (key == "roadblockCount") return value >= 0 && value <= 30; if (key == "civilianTrafficCount") return value >= 0 && value <= 6; if (key == "startMode") return value == 0 || value == 1; if (key == "keepWeaponOnUnconscious") return value == 0 || value == 1; diff --git a/addons/core/UI/layouts/ERR/AdminMenu.layout b/addons/core/UI/layouts/ERR/AdminMenu.layout index 5f707c2..210bd54 100644 --- a/addons/core/UI/layouts/ERR/AdminMenu.layout +++ b/addons/core/UI/layouts/ERR/AdminMenu.layout @@ -100,7 +100,7 @@ TextWidgetClass { Color 0.72 0.81 0.87 1 Text "0 disables convoys. Lost convoys stay lost. Next round." "Font Size" 14 "Min Font Size" 14 Wrap 1 FontProperties FontProperties { Font "{3E7733BAC8C831F6}UI/Fonts/RobotoCondensed/RobotoCondensed_Regular.fnt" } } -TextWidgetClass { Name "Label_roadblockCount" Slot FrameWidgetSlot { Anchor 0 0 0 0 PositionX 508 OffsetLeft 508 PositionY 66 OffsetTop 66 SizeX 456 OffsetRight -964 SizeY 26 OffsetBottom -92 } Color 0.9 0.92 0.94 1 Text "Roadblocks (0-12; 0 off)" "Font Size" 20 "Min Font Size" 20 Wrap 1 FontProperties FontProperties { Font "{3E7733BAC8C831F6}UI/Fonts/RobotoCondensed/RobotoCondensed_Regular.fnt" } } +TextWidgetClass { Name "Label_roadblockCount" Slot FrameWidgetSlot { Anchor 0 0 0 0 PositionX 508 OffsetLeft 508 PositionY 66 OffsetTop 66 SizeX 456 OffsetRight -964 SizeY 26 OffsetBottom -92 } Color 0.9 0.92 0.94 1 Text "Roadblocks (0-30; 0 off)" "Font Size" 20 "Min Font Size" 20 Wrap 1 FontProperties FontProperties { Font "{3E7733BAC8C831F6}UI/Fonts/RobotoCondensed/RobotoCondensed_Regular.fnt" } } ButtonWidgetClass : "{DA43C77A0D1E59F8}UI/layouts/ERR/AdminValue.layout" { Name "roadblockCount" Slot FrameWidgetSlot { Anchor 0 0 0 0 PositionX 508 OffsetLeft 508 PositionY 96 OffsetTop 96 SizeX 130 OffsetRight -638 SizeY 38 OffsetBottom -134 } components { SCR_EditBoxComponent "{547290FFBD5B33E9}" { m_sLabel "" } } } ButtonWidgetClass : "{75C912A1C89BE6C2}UI/layouts/WidgetLibrary/Buttons/WLib_ButtonText.layout" { Name "Apply_roadblockCount" Slot FrameWidgetSlot { Anchor 0 0 0 0 PositionX 650 OffsetLeft 650 PositionY 96 OffsetTop 96 SizeX 110 OffsetRight -760 SizeY 38 OffsetBottom -134 } components { SCR_ButtonTextComponent "{5548F0143AE99095}" { m_sText "Apply" } } } TextWidgetClass { Name "Saved_roadblockCount" Slot FrameWidgetSlot { Anchor 0 0 0 0 PositionX 508 OffsetLeft 508 PositionY 136 OffsetTop 136 SizeX 456 OffsetRight -964 SizeY 22 OffsetBottom -158 } Color 0.9 0.92 0.94 1 Text "Waiting for saved value" "Font Size" 16 "Min Font Size" 16 FontProperties FontProperties { Font "{3E7733BAC8C831F6}UI/Fonts/RobotoCondensed/RobotoCondensed_Regular.fnt" } } diff --git a/docs/configuration.md b/docs/configuration.md index 28ccee0..9f43b4c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -40,7 +40,7 @@ and `/esc mission startammo set N` (also `show` and `help`). ## Roadblocks The admin menu **Settings → Roadblocks next round** sets `mission.roadblockCount` -in `Escapists.json`: **0–12**, default **4**; **0 disables** them. The chat equivalent +in `Escapists.json`: **0–30**, default **4**; **0 disables** them. The chat equivalent is `/esc mission roadblocks set N` (also `show` and `help`). Changes apply on the next round/restart, leaving current units and cover in place. diff --git a/tests/test_roadblocks.py b/tests/test_roadblocks.py index e27b6b8..499f625 100644 --- a/tests/test_roadblocks.py +++ b/tests/test_roadblocks.py @@ -36,7 +36,7 @@ assert '"roadblockCount"' in body(settings,'static array Keys(') import re valid=re.search(r'if \(key == "roadblockCount"\) return ([^;]+);',body(settings,'static bool Valid('))[1] default=re.search(r'if \(key == "roadblockCount"\) return ([^;]+);',body(settings,'static int AddedDefault('))[1] -run('#include \nbool valid(int value){return '+valid+';}\nint main(){assert(!valid(-1)&&valid(0)&&valid(4)&&valid(12)&&!valid(13));assert('+default+'==4);}') +run('#include \nbool valid(int value){return '+valid+';}\nint main(){assert(!valid(-1)&&valid(0)&&valid(4)&&valid(12)&&valid(13)&&valid(30)&&!valid(31));assert('+default+'==4);}') s=p.read_text() assert s.index('m_Mode.Forces().Register(')