This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example usage | |
static func example_connect_to_network() -> Result: | |
return Result.fail(ERR_CANT_CONNECT) | |
static func example_load_file(conn: ENetConnection) -> Error: | |
return ERR_FILE_CORRUPT | |
class ApiResult: | |
extends RefCounted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get list of files and their status (unversioned, edited, added in working directory, etc.) | |
$ git status | |
# Get a detailed list of prior commits. Get information on where other branches are, relative to each other and the current HEAD. | |
$ git log | |
# Get a summarized list of commit hashes/messages starting from the HEAD all the way back to <branch>'s place in history. | |
$ git log --pretty=oneline <branch> | |
# When used from the root directory of a repo, adds all edited files to working directory. | |
# Make sure to only run this *after* you've got an updated .gitignore file. Otherwise, you will need to remove unwanted items from the working directory to prevent committing them. | |
$ git add . | |
# To quickly commit something with a summary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tool | |
class_name LootTable | |
extends Resource | |
export var _element_type: Script = null setget set_element_type | |
export var data := [] setget set_data | |
func set_data(p_value: Array) -> void: | |
# Validate element types. | |
# Only necessary because Godot doesn't yet have typed Arrays | |
# or exportable user-defined Resource types. Hopefully coming for 4.0. | |
for i in len(p_value): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# InputManager.gd | |
extends Node | |
export var wait_time := 0.5 | |
export var merge_time := 0.1 | |
var player_index := 0 | |
var buffer := [] | |
var _buf_timer: Timer = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends KinematicBody | |
var rotation_x_delta = 0.0 | |
var rotation_y_delta = 0.0 | |
func _unhandled_input(event): | |
if event is InputEventKey and not event.is_echo(): | |
match event.scancode: | |
KEY_A: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enum - generates radio buttons | |
enum { | |
SUIT_HEARTS, | |
SUIT_DIAMONDS, | |
SUIT_SPADES, | |
SUIT_CLUBS | |
} | |
export(int, "Hearts", "Diamonds", "Spades", "Clubs") var suit := SUIT_HEARTS | |
# flag enum - generates checkboxes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = Control.new() | |
add_control_to_container(EditorPlugin.CONTAINER_TOOLBAR, c) | |
for a_child in c.get_parent().get_children(): | |
if a_child is HBoxContainer: | |
for a_btn in a_child.get_children(): | |
if a_btn is BaseButton and a_btn.text == "Vim": | |
main_screen_btn = a_btn | |
break | |
if main_screen_btn: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copying this from an Unlicense repository | |
# https://github.com/xiosolox/Godot_PoissonDiskSampling/blob/master/GDscript/PoissonDisk.gd | |
extends Node | |
class_name PoissonDisk | |
export var width = 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tool | |
extends VBoxContainer | |
class_name VBoxItemList | |
signal item_inserted(p_index, p_data) | |
signal item_removed(p_index, p_data) | |
const ICON_ADD: Texture = preload("../icons/icon_add.svg") | |
const ICON_DELETE: Texture = preload("../icons/icon_import_fail.svg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
signal thread_finished(t) | |
var t | |
func _ready(): | |
t = Thread.new() | |
connect("thread_finished", self, "_on_thread_finished") | |
var params = { |
NewerOlder