Skip to content

Latest commit

 

History

History
71 lines (56 loc) · 3.63 KB

File metadata and controls

71 lines (56 loc) · 3.63 KB

Constant wrapper and settings-boolean forms

Emission writes constants and boolean settings in the forms that pinned OverPy 9.7.10 writes, because the Workshop client imports those forms in production projects. Acceptance of other spellings is unknown, and some are rejected. The evidence class is "deliberate upstream emission rule" in ADR-0014; a live-client capture overrides it.

The parser accepts both the wrapped and the bare spelling of every constant. Emission never preserves the input spelling; it applies the rule below.

Constant wrappers

The rule is keyed on the constant's domain, not on the parameter it fills, and is the same for every emit path (emit, convert, action layout) and locale.

Domain Written Example (en-US / zh-CN)
Hero Hero(Member) Hero(Mercy) / 英雄(天使)
Button Button(Member) Button(Reload) / 按钮(装填)
Color Color(Member) Color(Red) / 颜色(红色)
Map Map(Member) Map(Hanamura) / 地图(花村)
Team bare member Team 1, All Teams / 队伍1, 所有队伍
Every other enum domain bare member Up / 上

Hero, Button, Color, and Map are wrapped in Hero-typed parameters, Array elements, comparisons, and generic parameters alike. Team(Team 1) is never written. Game Mode(...) is a value function in the catalog, not a constant wrapper, and is preserved as parsed.

Team 1 and Team 2 are also Color members. In a Color-typed slot, their bare spelling resolves to the Team domain and stays bare; Color(Team 2) explicitly selects the Color member and stays wrapped. This preserves the domain expressed by the authored form when a slot accepts a value from another enum domain.

Evidence: pinned OverPy 9.7.10 compiled a probe covering each domain in Team-, Hero-, Array-, Compare-, and Custom String-argument positions, in en-US and zh-CN, and always wrote the forms above. The real-project fixtures generated by OverPy keep their Team(/Hero(/Button(/Color( call counts through parse and emit (tests/wrapper_forms.rs). Localized wrapper names are the domain aliases in the catalog (颜色, 英雄, 按钮, 地图).

Boolean settings

Settings declared KeyKind::YesNo take Yes/No (是/否); every other boolean setting takes On/Off. Only Allow Players Who Are In Queue and Swap Teams After Match are yes/no settings, as in the real-project fixtures generated by OverPy.

Multi-spelling actions

Where the catalog lists several zh-CN spellings for an action, the first is emitted and the others are parse aliases. For the ten actions that pinned OverPy 9.7.10 spells differently (消除所有图标, 消除所有地图文本, 消除所有效果, 消除所有HUD文本, 关闭游戏预设通告模式, 关闭游戏预设完成条件, 关闭游戏预设音乐模式, 关闭游戏预设计分模式, 开启游戏预设音乐模式, 比赛时间继续), the OverPy spelling is first.

The same rule applies to the Jinyu hero: pinned OverPy 9.7.10 and the Bastion fixture spell it Domina, so Domina is emitted and Jinyu remains a parse alias.

Other source-to-emit differences

For the fixtures generated by OverPy, emission adds no token absent from the input. Beyond the rules above this means: settings numbers keep their shortest round-trip spelling, hero settings use the producer alias in hero_setting_aliases.json before the export label (including the raw secondaryFireRechargeRate% key that OverPy writes for Roadhog in zh-CN), and the indexed player-variable actions keep their player, name argument pair.