Skip to content

Instantly share code, notes, and snippets.

View neikeq's full-sized avatar
🪐
Working from Saturn

Ignacio Roldán Etcheverry neikeq

🪐
Working from Saturn
  • Madrid
View GitHub Profile
@neikeq
neikeq / failed_attempt.cs
Last active January 7, 2017 18:27
Y U GIVE ME AN ABSOLUTE PATH :(
[System.AttributeUsage(System.AttributeTargets.Class)]
public class ScriptClass : System.Attribute
{
public string filePath;
public ScriptClass ([System.Runtime.CompilerServices.CallerFilePath] string path = "")
{
filePath = path;
}
}
@neikeq
neikeq / duck_typing.gd
Last active August 22, 2016 17:28
Duck typing example in GDScript. An adaptation of: https://en.wikipedia.org/wiki/Duck_typing#In_Python
class Duck extends Reference:
func quack():
print("Quack, quack!")
func fly():
print("Flap, Flap!")
class Person extends Reference:
func quack():
@neikeq
neikeq / DynamicTest.cs
Last active January 7, 2017 18:25
Too bad this is not supported on iOS
using System;
using System.Dynamic;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Reflection;
namespace DynamicTest
{
class MainClass
{

Godot editor features

  • The editor must automate edition of csproj files (add/remove scripts created by users, assembly references, etc), while also giving the user a panel to do it manually if needed. (in progress, for alpha)
  • Give the user some options for configuring csproj files from the editor. (This was the same as above...)
  • Exporting. Assemblies must be bundled with PCK files. (need to do this in the Godot repo)
  • Autocompletion and analysis with OmniSharp in the built-in editor. (very low priority, IDEs are the priority)
  • Debugging and profiling from the editor. (very low priority, IDEs are the priority)
  • Generate and build the C# bindings project for the correct Godot API version.

Language API

import std.stdio;
import std.file;
import std.algorithm;
import core.thread;
import std.process;
int main(string[] args)
{
writeln("Working directory: " ~ getcwd());
//stdout.flush();
@neikeq
neikeq / process.gd
Last active April 10, 2017 00:32
Example usage of the Process class from GDScript. Check below for example applications
extends Node
const BLOCKING = false
const PRINTRAW = true
onready var te = get_node("TextEdit")
var process = Process.new()
var timer = Timer.new()
def qedit__String(d, value, data):
val = d.fromNativeValue(value)
d.call('Error', val, 'resize', str(len(data) + 1))
d.setValues(val['_ptr'].extractPointer(), 'wchar_t', [ord(c) for c in data] + [ 0 ])
def qform__String():
return [SimpleFormat, SeparateFormat]
def qdump__String(d, value):
find core drivers editor main modules platform scene servers -regex ".*\.\(h\|hpp\|hxx\|c\|cpp\|cxx\|inc\)" -type f -exec sed -i -E "/^\s*(\/\/)*ClassDB::bind_method\(/ s/\"([a-zA-Z0-9_]*)(:[a-zA-Z0-9_]*)\"/\"\1\"/g" {} +
diff -ruN old/GodotSharp/Core/GD_constants.cs new/GodotSharp/Core/GD_constants.cs
--- old/GodotSharp/Core/GD_constants.cs 2018-10-18 17:52:23.978260000 +0200
+++ new/GodotSharp/Core/GD_constants.cs 2018-10-18 19:29:12.507585000 +0200
@@ -585,43 +585,43 @@
/// <summary>
/// Number 0
/// </summary>
- Y0 = 48,
+ Key0 = 48,
/// <summary>
@neikeq
neikeq / c_cpp_properties.json
Created December 12, 2018 23:34
My VSCode config files for Godot on Windows
{
"configurations": [
{
"name": "Windows",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/winrt",