Skip to content

Instantly share code, notes, and snippets.

View dalexeev's full-sized avatar

Danil Alexeev dalexeev

  • Russia
  • 08:24 (UTC +03:00)
View GitHub Profile
@warning_ignore_start("return_value_discarded")
@tool
class_name CustomLine2D
extends Line2D
enum _Source {
POINTS,
POINT_WIDTHS,
POINT_COLORS,
@warning_ignore_start("return_value_discarded")
@tool
extends EditorPlugin
enum _GV47 {
WINDOW_RUN_GAME_EMBEDDED = 6,
WINDOW_MAKE_FLOATING_ON_PLAY = 7,
WINDOW_SIZE_MODE_FIXED = 8,
@dalexeev
dalexeev / gdscript_3.0.md
Last active April 19, 2026 08:49
GDScript 3.0

GDScript 3.0

"GDScript 3.0" is the unofficial name for the hypothetical next implementation of GDScript. The term was coined by someone based on the unofficial term "GDScript 2.0", which refers to the GDScript implementation in Godot 4.0.

Motivation

  • GDScript was initially created as a very simple language, but over time its complexity and number of features increased. Users now expect GDScript to include many features common in general-purpose languages, such as interfaces/traits, nullable and generic types, namespaces, and more.
  • The current GDScript implementation has significant code duplication and technical debt. It is becoming increasingly difficult to maintain, implement new major features (especially those related to the type system), and fix complex bugs (especially those related to the caching/loading system).
  • The core has two duplicate systems for exposing the engine API: the scripting layer and GDExtension. Scripts are not full-fledged classes, but are instead merely attached to objec
@dalexeev
dalexeev / option_1.gd
Last active January 4, 2024 22:24
GDScript BBCode parser/preprocessor
# This option roughly matches the described requirements of `get_parsed_text()` emulation.
# See https://github.com/godotengine/godot/blob/179dfdc8d78b5bd5377dd115af026df58308bdaf/scene/gui/rich_text_label.cpp#L3999.
const TAGS_TO_STRIP: Array[String] = [
"b", "i", "code", "table", "cell", "u", "s", "center", "fill", "left", "right",
"ul", "ol", "lang", "p", "url", "hint", "dropcap", "color", "outline_color",
"font_size", "opentype_features", "otf", "font", "outline_size", "fade", "shake",
"wave", "tornado", "rainbow", "pulse", "bgcolor", "fgcolor",
]
@dalexeev
dalexeev / godot_type.cpp
Created October 8, 2023 17:18
GodotType
/**************************************************************************/
/* godot_type.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
class_name TestSetterGetterWithName
static var static_normal_untyped: set = set_static_normal_untyped, get = get_static_normal_untyped
static var static_normal_typed: int: set = set_static_normal_typed, get = get_static_normal_typed
static var static_named_untyped: set = set_static_named_untyped, get = get_static_named_untyped
static var static_named_typed: int: set = set_static_named_typed, get = get_static_named_typed
var normal_untyped: set = set_normal_untyped, get = get_normal_untyped
var normal_typed: int: set = set_normal_typed, get = get_normal_typed
var named_untyped: set = set_named_untyped, get = get_named_untyped
@@ -2,6 +2,7 @@ class DataType {
private:
// Private access so we can control memory management.
DataType *container_element_type = nullptr;
+ DataType *gussed_type = nullptr;
public:
enum Kind {
@@ -11,19 +12,12 @@ public:
CLASS, // GDScript.
class DataNode extends Object:
var index: int
var parent: DataNode
var children: Array[DataNode]
class DataHeap extends RefCounted:
var _heap := {} # id: int -> node: DataNode
var _max_id := -1
func add_node(id: int, parent_id: int) -> void: