Skip to content

Commit

Permalink
Fix wrong hint (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-semyonov authored Oct 19, 2024
1 parent 524bb87 commit 3b309b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/SwiftGodotMacroLibrary/MacroGodot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ class GodotMacroProcessor {
}

let name = "prop_\(propertyDeclarations.count)"
let hint = propType == ".array" ? ".arrayType" : ".none"
let hint: String

if propType == ".array" && hintStr != "" {
hint = ".arrayType"
} else {
hint = ".none"
}

// TODO: perhaps for these prop infos that are parameters to functions, we should not bother making them unique
// and instead share all the Ints, all the Floats and so on.
ctor.append (" let \(name) = PropInfo (propertyType: \(propType), propertyName: \"\", className: StringName(\"\(className)\"), hint: \(hint), hintStr: \"\(hintStr)\", usage: .default)\n")
Expand Down

0 comments on commit 3b309b6

Please sign in to comment.