Skip to content

Commit a9ada64

Browse files
committed
Automatically set divider character lengths
1 parent b88c492 commit a9ada64

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/hammeraddons/unify_fgd.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import argparse
1212
import itertools
1313
import sys
14+
import re
1415

1516
from srctools import fgd
1617
from srctools.fgd import (
@@ -1179,6 +1180,12 @@ def action_export(
11791180
for (mask, name, default, tags) in value.flags_list
11801181
if '-ENGINE' not in tags and '!ENGINE' not in tags
11811182
]
1183+
if (
1184+
isinstance(value, KVDef) and value.editor_only
1185+
and re.fullmatch("-{4,}", value.disp_name) is not None
1186+
):
1187+
# It's a divider, set a specific length, or blank it in engine mode.
1188+
value.disp_name = '-' if engine_mode else ('-' * 80)
11821189

11831190
# Check if this is a shared property among all ents,
11841191
# and if so skip exporting.

0 commit comments

Comments
 (0)