Use godot style for property names

This commit is contained in:
Ruslan Mustakov 2017-07-26 14:20:09 +07:00
commit dc00986f29
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
version = "0.2.1" version = "0.2.2"
author = "Xored Software, Inc." author = "Xored Software, Inc."
description = "Godot Engine bindings" description = "Godot Engine bindings"
license = "MIT" license = "MIT"

View file

@ -300,11 +300,11 @@ template registerGodotField(classNameLit, classNameIdent, propNameLit,
cast[classNameIdent](nimPtr).propNameIdent = nimVal cast[classNameIdent](nimPtr).propNameIdent = nimVal
of ConversionResult.TypeError: of ConversionResult.TypeError:
let errStr = typeError(propTypeLit, $val, val.getType(), let errStr = typeError(propTypeLit, $val, val.getType(),
classNameLit, propNameLit) classNameLit, astToStr(propNameIdent))
printError(errStr) printError(errStr)
of ConversionResult.RangeError: of ConversionResult.RangeError:
let errStr = rangeError(propTypeLit, $val, let errStr = rangeError(propTypeLit, $val,
classNameLit, propNameLit) classNameLit, astToStr(propNameIdent))
printError(errStr) printError(errStr)
proc getFuncIdent(obj: ptr GodotObject, methData: pointer, proc getFuncIdent(obj: ptr GodotObject, methData: pointer,
@ -408,7 +408,7 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
let usageIdent = ident(usage) let usageIdent = ident(usage)
result.add(getAst( result.add(getAst(
registerGodotField(classNameLit, classNameIdent, registerGodotField(classNameLit, classNameIdent,
newCStringLit($field.name.basename()), newCStringLit(toGodotStyle($field.name.basename())),
ident(field.name), newCStringLit($field.typ), ident(field.name), newCStringLit($field.typ),
field.typ, genSym(nskProc, "setFunc"), field.typ, genSym(nskProc, "setFunc"),
genSym(nskProc, "getFunc"), genSym(nskProc, "getFunc"),