Skip to content

Instantly share code, notes, and snippets.

View dalexeev's full-sized avatar

Danil Alexeev dalexeev

  • Russia
  • 01:40 (UTC +03:00)
View GitHub Profile
@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: