From fea5e5ab74781007dc3d0d83bb78212471cbb00a Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Tue, 12 Nov 2024 14:18:34 +1000 Subject: [PATCH] Add to changelog and test --- docs/source/changelog.rst | 2 ++ src/srctools/fgd.py | 12 ++++++------ tests/test_fgd.py | 2 +- tests/test_fgd/test_export_regressions_custom_.fgd | 2 +- tests/test_fgd/test_export_regressions_vanilla_.fgd | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 8ac03234..14321977 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -10,6 +10,8 @@ Version (dev) ------------- * #35: Only use character escapes in FGD custom syntax mode. The original parser only allows `\\n`. * Avoid escaping `/` and `?`, these are unambiguous. +* Add :py:attr:`ValueTypes.EXT_SOUNDSCAPE `. +* Support exporting FGDs with unevaulated string bases. ------------- Version 2.4.1 diff --git a/src/srctools/fgd.py b/src/srctools/fgd.py index f02b908a..d1e68a9b 100644 --- a/src/srctools/fgd.py +++ b/src/srctools/fgd.py @@ -85,13 +85,13 @@ class ValueTypes(Enum): TARG_DEST = 'target_destination' ENT_HANDLE = EHANDLE = TARG_DEST - TARG_DEST_CLASS = 'target_name_or_class' # Above + classnames. + TARG_DEST_CLASS = 'target_name_or_class' # A targetname for another ent, or a classname. TARG_SOURCE = 'target_source' # The 'targetname' keyvalue. - TARG_NPC_CLASS = 'npcclass' # targetnames filtered to NPC ents - TARG_POINT_CLASS = 'pointentityclass' # targetnames filtered to point entities. - TARG_FILTER_NAME = 'filterclass' # targetnames of filters. - TARG_NODE_DEST = 'node_dest' # name of a node - TARG_NODE_SOURCE = 'node_id' # name of us + TARG_NPC_CLASS = 'npcclass' # Targetnames filtered to NPC entities. + TARG_POINT_CLASS = 'pointentityclass' # Targetnames filtered to point entities. + TARG_FILTER_NAME = 'filterclass' # Targetnames filtered to filter entities. + TARG_NODE_DEST = 'node_dest' # Name of a node + TARG_NODE_SOURCE = 'node_id' # name of us. # Strings, don't need fixups STR_SCENE = 'scene' # VCD files diff --git a/tests/test_fgd.py b/tests/test_fgd.py index a4618683..6db58d72 100644 --- a/tests/test_fgd.py +++ b/tests/test_fgd.py @@ -555,7 +555,7 @@ def test_export_regressions(file_regression: FileRegressionFixture, custom_synta base_angles = EntityDef(EntityTypes.BASE, 'Angles') ent = EntityDef(EntityTypes.NPC, 'npc_test') - ent.bases = [base_origin, base_angles] + ent.bases = [base_origin, base_angles, 'MissingBase'] fgd.entities = { # 'origin': base_origin, diff --git a/tests/test_fgd/test_export_regressions_custom_.fgd b/tests/test_fgd/test_export_regressions_custom_.fgd index ae92fe5d..f2348618 100644 --- a/tests/test_fgd/test_export_regressions_custom_.fgd +++ b/tests/test_fgd/test_export_regressions_custom_.fgd @@ -9,7 +9,7 @@ origin(origin) : "Origin" : "0 0 0" ] -@NpcClass base(Origin, Angles) +@NpcClass base(Origin, Angles, MissingBase) sphere(radius, 255 128 64) studio(models/editor/a_prop.mdl) appliesto(-episodic) diff --git a/tests/test_fgd/test_export_regressions_vanilla_.fgd b/tests/test_fgd/test_export_regressions_vanilla_.fgd index 15427afc..be92f553 100644 --- a/tests/test_fgd/test_export_regressions_vanilla_.fgd +++ b/tests/test_fgd/test_export_regressions_vanilla_.fgd @@ -9,7 +9,7 @@ origin(origin) : "Origin" : "0 0 0" ] -@NpcClass base(Origin, Angles) +@NpcClass base(Origin, Angles, MissingBase) sphere(radius, 255 128 64) studio(models/editor/a_prop.mdl) extrahelper(1, 15, thirtytwo)