정수형 UI 숫자 표기 검증
This commit is contained in:
18
docs/integer-format.md
Normal file
18
docs/integer-format.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Integer Formatting Rules
|
||||
|
||||
MapleStory Worlds may serialize numeric properties as strings such as `1.0`.
|
||||
This is valid numeric data, but it must never be used directly for UI entity
|
||||
names or paths because `Card1.0` and `DmgPop_1.0` do not exist.
|
||||
|
||||
- Use `self:IntStr(value)` for every numeric suffix in a UI path or entity name.
|
||||
- Use `string.format("%d", math.floor(value or 0))` or `FormatNumber` for an
|
||||
integer shown in UI text.
|
||||
- Do not concatenate `tostring(number)` into a `/ui/...` path.
|
||||
- `tools/deck/gen-slaydeck.mjs` normalizes exact integer strings such as `0.0`
|
||||
to `0` when regenerating `Global/common.gamelogic`.
|
||||
|
||||
Run this check after editing card-controller UI paths:
|
||||
|
||||
```powershell
|
||||
node tools/verify/integer-format.mjs
|
||||
```
|
||||
Reference in New Issue
Block a user