NPCs talk to you when you push Z
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import sys
|
||||
import json
|
||||
import shared
|
||||
import textwrap
|
||||
|
||||
TEMPLATE = """
|
||||
// generated code! be nice
|
||||
@ -136,7 +137,7 @@ def format_field_value(ty, val):
|
||||
elif ty == "String":
|
||||
if val is None:
|
||||
return "NULL", "scalar", "const char*"
|
||||
return json.dumps(val), "scalar" # this is close enough to being right in C
|
||||
return json.dumps(wrap(val)), "scalar" # this is close enough to being right in C
|
||||
elif ty == "Array<Int>":
|
||||
return [format_field_value("Int", i)[0] for i in val], "array", "sys_i32"
|
||||
elif ty == "Array<String>":
|
||||
@ -145,6 +146,9 @@ def format_field_value(ty, val):
|
||||
assert False, f"unknown type: {ty}"
|
||||
|
||||
|
||||
def wrap(s):
|
||||
return textwrap.fill(s, width=28)
|
||||
|
||||
def annot_xy(lst, w, h):
|
||||
assert len(lst) == w * h
|
||||
for y in range(h):
|
||||
|
Reference in New Issue
Block a user