Skip to content

method assumes virtual methods always start with an underscore #87

@geekrelief

Description

@geekrelief

Example:
EditorPlugin.has_main_screen is a virtual method, but does not have an underscore.
https://docs.godotengine.org/en/stable/classes/class_editorplugin.html#class-editorplugin-method-has-main-screen

method hasMainScreen():bool = true

use of method on a proc assumes it's virtual

isVirtual: meth.kind == nnkMethodDef,

and gdobj prepends an underscore to all method names.

let godotMethodName = if meth.isVirtual: "_" & toGodotStyle(meth.name)

As a work around to override the virtual function you declare it as proc with gdExport like:

proc hasMainScreen():bool {.gdExport.} =
  true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions