Compare commits

34 Commits

Author SHA1 Message Date
56670cb0ba Manula wirte file tag
Some checks failed
Tests / Evaluate Tests on ubuntu-latest (push) Has been cancelled
Spellcheck / Spellcheck (push) Has been cancelled
2026-08-07 14:12:57 -04:00
14ad27fa99 t2
All checks were successful
Spellcheck / Spellcheck (push) Successful in 14s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m13s
2026-08-07 13:48:04 -04:00
1e8d33e436 needs package:?
Some checks failed
Spellcheck / Spellcheck (push) Successful in 14s
Tests / Evaluate Tests on ubuntu-latest (push) Failing after 31s
2026-08-07 13:44:58 -04:00
c5d5a0da61 Update SJKScripts
Some checks failed
Spellcheck / Spellcheck (push) Successful in 18s
Tests / Evaluate Tests on ubuntu-latest (push) Failing after 38s
2026-08-07 13:40:27 -04:00
fa5bc913a4 Added Methods to help with checking ray with a plane. 2026-07-05 13:48:32 -04:00
9f968fd814 removed emojies
All checks were successful
Spellcheck / Spellcheck (push) Successful in 13s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m2s
2026-06-10 17:05:58 -04:00
8062242c1a brute force
All checks were successful
Spellcheck / Spellcheck (push) Successful in 12s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m2s
2026-06-10 16:48:58 -04:00
157a4d38b1 Atempent 2
All checks were successful
Spellcheck / Spellcheck (push) Successful in 15s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m2s
2026-06-10 16:44:40 -04:00
ceb4b81b36 why not work
All checks were successful
Spellcheck / Spellcheck (push) Successful in 13s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m3s
2026-06-10 16:27:50 -04:00
82ff05fb30 HELP
All checks were successful
Spellcheck / Spellcheck (push) Successful in 14s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m4s
2026-06-10 16:20:33 -04:00
5a6414b2dd seeing if chaning vesion in godot csproj works, and patch
All checks were successful
Spellcheck / Spellcheck (push) Successful in 17s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m2s
2026-06-10 16:05:42 -04:00
dceaea78c6 attepted fix in wrong spot.
All checks were successful
Spellcheck / Spellcheck (push) Successful in 13s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m7s
2026-06-10 15:10:54 -04:00
d05e0b8710 Trying to fix uid causing spellcheck error
Some checks failed
Spellcheck / Spellcheck (push) Failing after 13s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m4s
2026-06-10 15:04:54 -04:00
9b83721f17 SJK scriptts Bumped to 1.0.17
Some checks failed
Spellcheck / Spellcheck (push) Failing after 1m39s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 1m18s
2026-06-10 14:35:17 -04:00
247300c09c Bumped SJKScript Vesion and added vector Lerp 2026-06-10 14:34:33 -04:00
28c5f3ac1a added fetch tags to see if helps
Some checks failed
Spellcheck / Spellcheck (push) Failing after 26s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 2m21s
2026-04-14 00:23:39 -04:00
9852d6da0a readded emojies to test of mysql is not suportiogn them
Some checks failed
Tests / Evaluate Tests on ubuntu-latest (push) Has been cancelled
Spellcheck / Spellcheck (push) Has been cancelled
2026-04-14 00:06:19 -04:00
091e8c086a removed emojies from readme
Some checks failed
Spellcheck / Spellcheck (push) Failing after 24s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 2m12s
2026-04-13 23:40:57 -04:00
b10a2ebdc9 wrong brach tag
Some checks failed
Spellcheck / Spellcheck (push) Failing after 23s
Build NuGet / build (push) Failing after 1m10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 2m14s
2026-04-13 23:10:57 -04:00
d2a0b0b007 more anoyed testing
Some checks failed
Spellcheck / Spellcheck (push) Failing after 29s
Tests / Evaluate Tests on ubuntu-latest (push) Has been cancelled
2026-04-13 23:10:05 -04:00
048ea69d47 test build from diffrent project
Some checks failed
Spellcheck / Spellcheck (push) Failing after 31s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 2m17s
2026-04-13 13:11:50 -04:00
d753ce67c3 fixed secret
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 50s
2026-04-10 21:47:44 -04:00
c0751c34df relse 2
Some checks failed
Spellcheck / Spellcheck (push) Failing after 9s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 51s
2026-04-10 21:39:32 -04:00
3341125442 YAY
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 51s
2026-04-10 21:29:35 -04:00
4f9cf7f62b more cspell fixed, and acidltal paste into release
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 51s
2026-04-10 21:11:09 -04:00
1951a0f2e7 removed reqiments for HG_BASIC
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 55s
2026-04-10 21:06:27 -04:00
39ab19eec0 add some comments and commented out HG_Basic
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 51s
2026-04-10 21:02:05 -04:00
d2f16fee48 same as previous
Some checks failed
Spellcheck / Spellcheck (push) Failing after 9s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 55s
2026-04-10 20:50:12 -04:00
faf7449802 trying to get github working
Some checks failed
Spellcheck / Spellcheck (push) Failing after 9s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 51s
2026-04-10 20:47:05 -04:00
7266590bbf token
Some checks failed
Spellcheck / Spellcheck (push) Failing after 11s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 55s
2026-04-10 20:45:07 -04:00
b38656c923 added cspell and better source
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Successful in 55s
2026-04-10 20:41:00 -04:00
91bd5428a7 nuget source
Some checks failed
Spellcheck / Spellcheck (push) Failing after 10s
Tests / Evaluate Tests on ubuntu-latest (push) Failing after 27s
2026-04-10 20:35:08 -04:00
55cc53dad4 removed emojies
Some checks failed
Spellcheck / Spellcheck (push) Failing after 50s
Tests / Evaluate Tests on ubuntu-latest (push) Failing after 1m1s
2026-04-10 20:26:47 -04:00
d605edf6bf local nuget gitea 2026-04-10 20:16:21 -04:00
15 changed files with 184 additions and 83 deletions

View File

@@ -14,10 +14,10 @@
# You can disable this action by setting the DISABLE_AUTO_RELEASE repository # You can disable this action by setting the DISABLE_AUTO_RELEASE repository
# variable to true. # variable to true.
name: '🦾 Auto-Release' name: 'Auto-Release'
on: on:
workflow_run: workflow_run:
workflows: ["🚥 Tests"] workflows: ["Tests"]
branches: branches:
- main - main
types: types:
@@ -25,25 +25,25 @@ on:
jobs: jobs:
auto_release: auto_release:
name: 🦾 Auto-Release name: Auto-Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
should_release: ${{ steps.release.outputs.should_release }} should_release: ${{ steps.release.outputs.should_release }}
steps: steps:
- name: 🧾 Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
# Use your GitHub Personal Access Token variable here. # Use your GitHub Personal Access Token variable here.
token: ${{ secrets.GH_BASIC }} token: ${{ secrets.NUGET_KEY }}
lfs: true lfs: true
submodules: 'recursive' submodules: 'recursive'
- name: 🧑‍🔬 Check Test Results - name: Check Test Results
id: tests id: tests
run: | run: |
echo "passed=${{ github.event.workflow_run.conclusion == 'success' }}" >> "$GITHUB_OUTPUT" echo "passed=${{ github.event.workflow_run.conclusion == 'success' }}" >> "$GITHUB_OUTPUT"
- name: 📄 Check If Dependencies Changed - name: Check If Dependencies Changed
id: deps id: deps
run: | run: |
message=$(git log -1 --pretty=%B) message=$(git log -1 --pretty=%B)
@@ -54,7 +54,7 @@ jobs:
echo "changed=false" >> "$GITHUB_OUTPUT" echo "changed=false" >> "$GITHUB_OUTPUT"
fi fi
- name: 📝 Check Release Status - name: Check Release Status
id: release id: release
run: | run: |
echo "Tests passed: ${{ steps.tests.outputs.passed }}" echo "Tests passed: ${{ steps.tests.outputs.passed }}"
@@ -64,10 +64,10 @@ jobs:
if [[ ${{ steps.tests.outputs.passed }} == "true" && ${{ steps.deps.outputs.changed }} == "true" && $disable_auto_release != "true" ]]; then if [[ ${{ steps.tests.outputs.passed }} == "true" && ${{ steps.deps.outputs.changed }} == "true" && $disable_auto_release != "true" ]]; then
echo "should_release=true" >> "$GITHUB_OUTPUT" echo "should_release=true" >> "$GITHUB_OUTPUT"
echo "🦾 Creating a release!" echo "Creating a release!"
else else
echo "should_release=false" >> "$GITHUB_OUTPUT" echo "should_release=false" >> "$GITHUB_OUTPUT"
echo "Not creating a release." echo "Not creating a release."
fi fi
trigger_release: trigger_release:
@@ -79,3 +79,4 @@ jobs:
GH_BASIC: ${{ secrets.GH_BASIC }} GH_BASIC: ${{ secrets.GH_BASIC }}
with: with:
bump: patch bump: patch
#994139c880db4bab879ae724ce1ac43b87c88e42

View File

@@ -1,4 +1,4 @@
name: '📦 Release' name: 'Release'
on: on:
# Make a release whenever the developer wants. # Make a release whenever the developer wants.
workflow_dispatch: workflow_dispatch:
@@ -26,31 +26,32 @@ on:
default: "patch" default: "patch"
jobs: jobs:
release: release:
name: '📦 Release' name: 'Release'
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true DOTNET_NOLOGO: true
steps: steps:
- name: 🧾 Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v7
with: with:
token: ${{ secrets.GH_BASIC }} token: ${{ secrets.GH_BASIC }}
lfs: true lfs: true
submodules: 'recursive' submodules: 'recursive'
fetch-depth: 0 # So we can get all tags. fetch-depth: 0 # So we can get all tags.
# fetch-tags: true
- name: 🔎 Read Current Project Version - name: Read Current Project Version
id: current-version id: current-version
uses: WyriHaximus/github-action-get-previous-tag@v2 uses: WyriHaximus/github-action-get-previous-tag@v2
with: with:
fallback: "0.0.0-devbuild" fallback: "0.0.0-devbuild"
- name: 🖨 Print Current Version - name: Print Current Version
run: | run: |
echo "Current Version: ${{ steps.current-version.outputs.tag }}" echo "Current Version: ${{ steps.current-version.outputs.tag }}"
- name: 🧮 Compute Next Version - name: Compute Next Version
uses: chickensoft-games/next-godot-csproj-version@v1 uses: chickensoft-games/next-godot-csproj-version@v1
id: next-version id: next-version
with: with:
@@ -59,41 +60,53 @@ jobs:
bump: ${{ inputs.bump }} bump: ${{ inputs.bump }}
- uses: actions/setup-dotnet@v5 - uses: actions/setup-dotnet@v5
name: 💽 Setup .NET SDK name: Setup .NET SDK
with: with:
# Use the .NET SDK from global.json in the root of the repository. # Use the .NET SDK from global.json in the root of the repository.
global-json-file: global.json global-json-file: global.json
# Write version to file so .NET will build correct version. # Write version to file so .NET will build correct version.
- name: 📝 Write Version to File - name: Write Version to File
uses: jacobtomlinson/gha-find-replace@v3 run: |
with: sed -i 's/0\.0\.0-devbuild/${{ steps.next-version.outputs.version }}/g' \
find: "0.0.0-devbuild" GodotHelper/GodotHelper.csproj
replace: ${{ steps.next-version.outputs.version }} # uses: jacobtomlinson/gha-find-replace@v3
regex: false # with:
include: GodotHelper/GodotHelper.csproj # find: "0.0.0-devbuild"
# replace: ${{ steps.next-version.outputs.version }}
# regex: false
# include: GodotHelper/GodotHelper.csproj
- name: 📦 Build - name: Build
working-directory: GodotHelper working-directory: GodotHelper
run: dotnet build -c Release run: dotnet build -c Release
- name: 🔎 Get Package Path - name: Get Package Path
id: package-path id: package-path
run: | run: |
package=$(find ./GodotHelper/nupkg -name "*.nupkg") package=$(find ./GodotHelper/nupkg -name "*.nupkg")
echo "package=$package" >> "$GITHUB_OUTPUT" echo "package=$package" >> "$GITHUB_OUTPUT"
echo "📦 Found package: $package" echo "Found package: $package"
echo "${{ steps.package-path.outputs.package }}"
- name: Create Release # - name: Create Release
env: # run: |
GITHUB_TOKEN: ${{ secrets.GH_BASIC }} # version="${{ steps.next-version.outputs.version }}"
run: |
version="${{ steps.next-version.outputs.version }}"
gh release create --title "v$version" --generate-notes "$version" \
"${{ steps.package-path.outputs.package }}"
- name: 🛜 Publish to Nuget # curl -X POST "https://gitea.superjrking.com/api/packages/Ronnie/GodotHelpers/releases" \
# -H "Authorization: token ${{ secrets.GH_BASIC }}" \
# -H "Content-Type: application/json" \
# -d "{
# \"tag_name\": \"$version\",
# \"name\": \"v$version\",
# \"body\": \"Auto release $version\"
# }"
- name: Publish to Nuget
run: | run: |
dotnet nuget push "${{ steps.package-path.outputs.package }}" \ dotnet nuget push "${{ steps.package-path.outputs.package }}" \
--api-key "${{ secrets.NUGET_API_KEY }}" \ --source "https://gitea.superjrking.com/api/packages/Ronnie/nuget/index.json" \
--source "https://api.nuget.org/v3/index.json" --skip-duplicate --allow-insecure-connections \
--api-key "${{ secrets.NUGET_KEY }}" \
--skip-duplicate

View File

@@ -1,11 +1,11 @@
name: '🧑‍🏫 Spellcheck' name: 'Spellcheck'
on: on:
push: push:
pull_request: pull_request:
jobs: jobs:
spellcheck: spellcheck:
name: '🧑‍🏫 Spellcheck' name: 'Spellcheck'
# Only run the workflow if it's not a PR or if it's a PR from a fork. # Only run the workflow if it's not a PR or if it's a PR from a fork.
# This prevents duplicate workflows from running on PR's that originate # This prevents duplicate workflows from running on PR's that originate
# from the repository itself. # from the repository itself.
@@ -16,10 +16,10 @@ jobs:
working-directory: '.' working-directory: '.'
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
name: 🧾 Checkout name: Checkout
- uses: streetsidesoftware/cspell-action@v8 - uses: streetsidesoftware/cspell-action@v8
name: 📝 Check Spelling name: Check Spelling
with: with:
config: './cspell.json' config: './cspell.json'
incremental_files_only: false incremental_files_only: false

View File

@@ -1,11 +1,11 @@
name: 🚥 Tests name: Tests
on: on:
push: push:
pull_request: pull_request:
jobs: jobs:
tests: tests:
name: 🧪 Evaluate Tests on ${{ matrix.os }} name: Evaluate Tests on ${{ matrix.os }}
# Only run the workflow if it's not a PR or if it's a PR from a fork. # Only run the workflow if it's not a PR or if it's a PR from a fork.
# This prevents duplicate workflows from running on PR's that originate # This prevents duplicate workflows from running on PR's that originate
# from the repository itself. # from the repository itself.
@@ -16,7 +16,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
# Put the operating systems you want to run on here. # Put the operating systems you want to run on here.
os: [ubuntu-latest, macos-latest, windows-2025] os: [ubuntu-latest]
env: env:
DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true DOTNET_NOLOGO: true
@@ -25,22 +25,22 @@ jobs:
# Use bash shells on all platforms. # Use bash shells on all platforms.
shell: bash shell: bash
steps: steps:
- name: 🧾 Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
lfs: true lfs: true
submodules: 'recursive' submodules: 'recursive'
- name: 💽 Setup .NET SDK - name: Setup .NET SDK
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v5
with: with:
# Use the .NET SDK from global.json in the root of the repository. # Use the .NET SDK from global.json in the root of the repository.
global-json-file: global.json global-json-file: global.json
- name: 📦 Restore Dependencies - name: Restore Dependencies
run: dotnet restore run: dotnet restore
- name: 🤖 Setup Godot - name: Setup Godot
uses: chickensoft-games/setup-godot@v2 uses: chickensoft-games/setup-godot@v2
with: with:
# Version must include major, minor, and patch, and be >= 4.0.0 # Version must include major, minor, and patch, and be >= 4.0.0
@@ -52,13 +52,13 @@ jobs:
# renovatebot updates the Godot SDK version. # renovatebot updates the Godot SDK version.
version: global.json version: global.json
- name: 🧑‍🔬 Generate .NET Bindings - name: Generate .NET Bindings
working-directory: GodotHelper.Tests working-directory: GodotHelper.Tests
run: godot --headless --build-solutions --quit || exit 0 run: godot --headless --build-solutions --quit || exit 0
- name: 🦺 Build Projects - name: Build Projects
run: dotnet build run: dotnet build
- name: 🧪 Run Tests - name: Run Tests
working-directory: GodotHelper.Tests working-directory: GodotHelper.Tests
run: godot --headless --run-tests --quit-on-finish run: godot --headless --run-tests --quit-on-finish

View File

@@ -48,6 +48,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="GodotSharp" Version="4.6.2" /> <PackageReference Include="GodotSharp" Version="4.6.2" />
<PackageReference Include="SjkScripts" Version="1.0.15" /> <PackageReference Include="SjkScripts" Version="1.0.19" />
<!-- [1.2.3,2.3.4] use range of versions -->
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -8,7 +8,7 @@ public static partial class SJKMath
// Mathf.Lerp(from.Y, to.Y, weight), // Mathf.Lerp(from.Y, to.Y, weight),
// Mathf.Lerp(from.Z, to.Z, weight) // Mathf.Lerp(from.Z, to.Z, weight)
// ); // );
public static Vector3 Lerp(Vector3 from, Vector3 to, float weight) => new Vector3( public static Vector3 Lerp(this Vector3 from, Vector3 to, float weight) => new Vector3(
Mathf.Lerp(from.X, to.X, weight), Mathf.Lerp(from.X, to.X, weight),
Mathf.Lerp(from.Y, to.Y, weight), Mathf.Lerp(from.Y, to.Y, weight),
Mathf.Lerp(from.Z, to.Z, weight) Mathf.Lerp(from.Z, to.Z, weight)
@@ -17,7 +17,7 @@ public static partial class SJKMath
// Mathf.Lerp(from.X, to.X, weight), // Mathf.Lerp(from.X, to.X, weight),
// Mathf.Lerp(from.Y, to.Y, weight) // Mathf.Lerp(from.Y, to.Y, weight)
// ); // );
public static Vector2 Lerp(Vector2 from, Vector2 to, float weight) => new Vector2( public static Vector2 Lerp(this Vector2 from, Vector2 to, float weight) => new Vector2(
Mathf.Lerp(from.X, to.X, weight), Mathf.Lerp(from.X, to.X, weight),
Mathf.Lerp(from.Y, to.Y, weight) Mathf.Lerp(from.Y, to.Y, weight)
); );

View File

@@ -0,0 +1,14 @@
namespace GodotHelpers;
using Godot;
public static partial class SJKMath
{
public static Vector3? MouseToPlane(this Plane plane, Camera3D viewCamera, Vector2? mousePos = null)
{
var from = viewCamera.ProjectRayOrigin( mousePos ?? viewCamera.GetViewport().GetMousePosition());
var normal = viewCamera.ProjectRayNormal(mousePos ?? viewCamera.GetViewport().GetMousePosition());
return plane.IntersectsRay(from, normal);
}
public static Vector3? MouseToGroundPlane(this Camera3D viewCamera, Vector2? mousePos = null, float offset = 0) =>
(Plane.PlaneXZ with { D = offset }).MouseToPlane(viewCamera, mousePos);
}

View File

@@ -0,0 +1,33 @@
namespace GodotHelpers;
using Godot;
public static partial class SJKMath
{
public static Vector3I RoundToIntVector(this Vector3 vector) => new Vector3I(
Mathf.RoundToInt(vector.X),
Mathf.RoundToInt(vector.Y),
Mathf.RoundToInt(vector.Z)
);
public static Vector3I FloorToIntVector(this Vector3 vector) => new Vector3I(
Mathf.FloorToInt(vector.X),
Mathf.FloorToInt(vector.Y),
Mathf.FloorToInt(vector.Z)
);
public static Vector3I CeilToIntVector(this Vector3 vector) => new Vector3I(
Mathf.CeilToInt(vector.X),
Mathf.CeilToInt(vector.Y),
Mathf.CeilToInt(vector.Z)
);
public static Vector2I RoundToIntVector(this Vector2 vector) => new Vector2I(
Mathf.RoundToInt(vector.X),
Mathf.RoundToInt(vector.Y)
);
public static Vector2I FloorToIntVector(this Vector2 vector) => new Vector2I(
Mathf.FloorToInt(vector.X),
Mathf.FloorToInt(vector.Y)
);
public static Vector2I CeilToIntVector(this Vector2 vector) => new Vector2I(
Mathf.CeilToInt(vector.X),
Mathf.CeilToInt(vector.Y)
);
}

View File

@@ -3,7 +3,7 @@ namespace GodotHelpers;
using System; using System;
using System.Linq; using System.Linq;
using Godot; using Godot;
using SJK.Functional;
public static class MyNodeExtensions public static class MyNodeExtensions
{ {
@@ -11,10 +11,10 @@ public static class MyNodeExtensions
/// <summary> /// <summary>
/// Checks if given Property exists on <c>Base</c> /// Checks if given Property exists on <c>Base</c>
/// </summary> /// </summary>
/// <param name="Base">Current <c>GodotObject</c></param> /// <param name="base">Current <c>GodotObject</c></param>
/// <param name="PropertyName">Property Name</param> /// <param name="propertyName">Property Name</param>
/// <returns><c>bool</c> true if given property exists on Base</returns> /// <returns><c>bool</c> true if given property exists on Base</returns>
public static bool HasProperty(this GodotObject Base, string PropertyName) public static bool HasProperty(this GodotObject @base, string propertyName)
{ {
/* /*
Returns the object's property list as an Godot.Collections.Array of dictionaries. Returns the object's property list as an Godot.Collections.Array of dictionaries.
@@ -26,9 +26,9 @@ public static class MyNodeExtensions
- hint_string depends on the hint (see PropertyHint); - hint_string depends on the hint (see PropertyHint);
- usage is a combination of PropertyUsageFlags. - usage is a combination of PropertyUsageFlags.
*/ */
foreach (var Property in Base.GetPropertyListEx()) foreach (var property in @base.GetPropertyListEx())
{ {
if (Property.Name == PropertyName) if (property.Name == propertyName)
{ {
return true; return true;
} }
@@ -39,8 +39,9 @@ public static class MyNodeExtensions
public static (Node node, Resource resource, NodePath remaining) GetNodeAndResourceEx(this Node self, NodePath path) public static (Node node, Resource resource, NodePath remaining) GetNodeAndResourceEx(this Node self, NodePath path)
{ {
var result = self.GetNodeAndResource(path); var result = self.GetNodeAndResource(path);
return ((Node)result[0], (Resource)result[1], (NodePath)result[2]); return ((Node)(GodotObject)result[0], (Resource)(GodotObject)result[1], (NodePath)result[2]);
} }
public static void QueueFreeChildren(this Node node) => node.GetChildren().ToList().ForEach(item => item.QueueFree()); public static void QueueFreeChildren(this Node node) => node.GetChildren().ToList().ForEach(item => item.QueueFree());
public static void QueueFreeChildren(this Node node, Func<Node, bool> predicate) => node.GetChildren().Where(predicate).ToList().ForEach(item => item.QueueFree()); public static void QueueFreeChildren(this Node node, Func<Node, bool> predicate) => node.GetChildren().Where(predicate).ToList().ForEach(item => item.QueueFree());
} }

View File

@@ -1,12 +1,14 @@
namespace GodotHelpers.Raycasts;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Godot; using Godot;
using Godot.Collections; using Godot.Collections;
using SJK.Functional; using SJK.Functional;
namespace GodotHelpers.Raycasts; /// <summary>
/// Extensions for <see cref="PhysicsDirectSpaceState3D"/>.
/// Allows for an static way of casting an godot Raycast3D.
/// </summary>
public static class RaycastExtensions public static class RaycastExtensions
{ {
// --- 3D --- // --- 3D ---
@@ -45,6 +47,10 @@ public static class RaycastExtensions
// --- 2D --- // --- 2D ---
/// <summary>
/// Extensions for <see cref="PhysicsDirectSpaceState2D"/>.
/// Allows for an static way of casting an godot Raycast3D.
/// </summary>
public static RaycastResult2D? RaycastEx(this PhysicsDirectSpaceState2D space, Vector2 from, Vector2 to, uint collisionMask = uint.MaxValue, Rid[]? exclude = null, bool hitFromInside = false) public static RaycastResult2D? RaycastEx(this PhysicsDirectSpaceState2D space, Vector2 from, Vector2 to, uint collisionMask = uint.MaxValue, Rid[]? exclude = null, bool hitFromInside = false)
{ {
var query = new PhysicsRayQueryParameters2D var query = new PhysicsRayQueryParameters2D

View File

@@ -1,7 +1,7 @@
using Godot;
namespace GodotHelpers.Raycasts; namespace GodotHelpers.Raycasts;
using Godot;
public record ShapeCastResult3D( public record ShapeCastResult3D(
GodotObject Collider, GodotObject Collider,
int ColliderId, int ColliderId,

View File

@@ -1,8 +1,8 @@
namespace SJK.GodotHelpers;
using System; using System;
using System.Collections.Generic;
using Godot; using Godot;
using Godot.Collections; using Godot.Collections;
namespace SJK.GodotHelpers;
public static class VariantUtils public static class VariantUtils
{ {
@@ -73,6 +73,18 @@ public static class VariantUtils
Variant.Type.Signal => typeof(Signal), Variant.Type.Signal => typeof(Signal),
Variant.Type.Dictionary => typeof(Dictionary), Variant.Type.Dictionary => typeof(Dictionary),
Variant.Type.Array => typeof(Godot.Collections.Array), Variant.Type.Array => typeof(Godot.Collections.Array),
Variant.Type.Projection => throw new NotImplementedException(),
Variant.Type.PackedByteArray => throw new NotImplementedException(),
Variant.Type.PackedInt32Array => throw new NotImplementedException(),
Variant.Type.PackedInt64Array => throw new NotImplementedException(),
Variant.Type.PackedFloat32Array => throw new NotImplementedException(),
Variant.Type.PackedFloat64Array => throw new NotImplementedException(),
Variant.Type.PackedStringArray => throw new NotImplementedException(),
Variant.Type.PackedVector2Array => throw new NotImplementedException(),
Variant.Type.PackedVector3Array => throw new NotImplementedException(),
Variant.Type.PackedColorArray => throw new NotImplementedException(),
Variant.Type.PackedVector4Array => throw new NotImplementedException(),
Variant.Type.Max => throw new NotImplementedException(),
_ => typeof(object) _ => typeof(object)
}; };
} }

14
NuGet.Config Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="coverlet" value="https://pkgs.dev.azure.com/tonerdo/coverlet/_packaging/coverlet-nightly/nuget/v3/index.json" />
<add key="gitea" value="https://gitea.superjrking.com/api/packages/Ronnie/nuget/index.json"/>
</packageSources>
<packageSourceCredentials>
<gitea>
<add key="Username" value="Ronnie" />
<add key="ClearTextPassword" value="e59e39d60f30b539ae594d8cfc7a9771883d2eb0" />
</gitea>
</packageSourceCredentials>
</configuration>

View File

@@ -10,7 +10,7 @@ A .NET template for quickly creating a C# nuget package for use with Godot 4.
<img alt="GodotHelper" src="GodotHelper/icon.png" width="200"> <img alt="GodotHelper" src="GodotHelper/icon.png" width="200">
</p> </p>
## 🥚 Getting Started ## Getting Started
This template allows you to easily create a nuget package for use in Godot 4 C# projects. Microsoft's `dotnet` tool allows you to easily create, install, and use templates. This template allows you to easily create a nuget package for use in Godot 4 C# projects. Microsoft's `dotnet` tool allows you to easily create, install, and use templates.
@@ -27,11 +27,11 @@ $GODOT --headless --build-solutions --quit
dotnet build dotnet build
``` ```
## 💁 Getting Help ## Getting Help
*Is this template broken? Encountering obscure C# build problems?* We'll be happy to help you in the [Chickensoft Discord server][discord]. *Is this template broken? Encountering obscure C# build problems?* We'll be happy to help you in the [Chickensoft Discord server][discord].
## 🏝 Environment Setup ## Environment Setup
For the provided debug configurations and test coverage to work correctly, you must setup your development environment correctly. The [Chickensoft Setup Docs][setup-docs] describe how to setup your Godot and C# development environment, following Chickensoft's best practices. For the provided debug configurations and test coverage to work correctly, you must setup your development environment correctly. The [Chickensoft Setup Docs][setup-docs] describe how to setup your Godot and C# development environment, following Chickensoft's best practices.
@@ -45,7 +45,7 @@ This template includes some Visual Studio Code settings in `.vscode/settings.jso
The included [`global.json`](./global.json) specifies the version of the .NET SDK that the included projects should use. It also specifies the `Godot.NET.Sdk` version that the included test project should use (since tests run inside an actual Godot game so you can use the full Godot API to verify your package is working as intended). The included [`global.json`](./global.json) specifies the version of the .NET SDK that the included projects should use. It also specifies the `Godot.NET.Sdk` version that the included test project should use (since tests run inside an actual Godot game so you can use the full Godot API to verify your package is working as intended).
## 🐞 Debugging ## Debugging
You can debug the included test project for your package in `GodotHelper.Tests/` by opening the root of this repository in VSCode and selecting one of the launch configurations: `Debug Tests` or `Debug Current Test`. You can debug the included test project for your package in `GodotHelper.Tests/` by opening the root of this repository in VSCode and selecting one of the launch configurations: `Debug Tests` or `Debug Current Test`.
@@ -55,7 +55,7 @@ The launch profiles will trigger a build (without restoring packages) and then i
> **Important:** You must setup a `GODOT` environment variable for the launch configurations above. If you're using [GodotEnv] to install and manage Godot versions, you're already setup! For more info, see the [Chickensoft Setup Docs][setup-docs]. > **Important:** You must setup a `GODOT` environment variable for the launch configurations above. If you're using [GodotEnv] to install and manage Godot versions, you're already setup! For more info, see the [Chickensoft Setup Docs][setup-docs].
## 👷 Testing ## Testing
By default, a test project in `GodotHelper.Tests/` is created for you to write tests for your package. [GoDotTest] is already included and setup, allowing you to focus on development and testing. By default, a test project in `GodotHelper.Tests/` is created for you to write tests for your package. [GoDotTest] is already included and setup, allowing you to focus on development and testing.
@@ -68,7 +68,7 @@ If you run Godot with the `--run-tests` command line argument, the game will run
Please see `test/ExampleTest.cs` and the [GoDotTest] readme for more examples. Please see `test/ExampleTest.cs` and the [GoDotTest] readme for more examples.
## 🚦 Test Coverage ## Test Coverage
Code coverage requires a few `dotnet` global tools to be installed first. You should install these tools from the root of the project directory. Code coverage requires a few `dotnet` global tools to be installed first. You should install these tools from the root of the project directory.
@@ -94,11 +94,11 @@ cd GodotHelper.Tests
You can also run test coverage through VSCode by opening the command palette and selecting `Tasks: Run Task` and then choosing `coverage`. You can also run test coverage through VSCode by opening the command palette and selecting `Tasks: Run Task` and then choosing `coverage`.
## 🏭 CI/CD ## CI/CD
This package includes various GitHub Actions workflows to make developing and deploying your package easier. This package includes various GitHub Actions workflows to make developing and deploying your package easier.
### 🚥 Tests ### Tests
Tests run on every push or pull request to the repository. You can configure which platforms you want to run tests on in [`.github/workflows/tests.yaml`](.github/workflows/tests.yaml). Tests run on every push or pull request to the repository. You can configure which platforms you want to run tests on in [`.github/workflows/tests.yaml`](.github/workflows/tests.yaml).
@@ -106,7 +106,7 @@ By default, tests run each platform (macOS, Windows, and Linux) using the latest
Tests are executed by running the Godot test project in `GodotHelper.Tests` from the command line and passing in the relevant arguments to Godot so that [GoDotTest] can discover and run tests. Tests are executed by running the Godot test project in `GodotHelper.Tests` from the command line and passing in the relevant arguments to Godot so that [GoDotTest] can discover and run tests.
### 🧑‍🏫 Spellcheck ### Spellcheck
A spell check runs on every push or pull request to the repository. Spellcheck settings can be configured in [`.github/workflows/spellcheck.yaml`](.github/workflows/spellcheck.yaml) A spell check runs on every push or pull request to the repository. Spellcheck settings can be configured in [`.github/workflows/spellcheck.yaml`](.github/workflows/spellcheck.yaml)
@@ -116,7 +116,7 @@ You can also words to the local `cspell.json` file from VSCode by hovering over
![Fix Spelling](docs/spelling_fix.png) ![Fix Spelling](docs/spelling_fix.png)
### 📦 Release ### Release
The included workflow in [`.github/workflows/release.yaml`](.github/workflows/publish.yaml) can be manually dispatched when you're ready to make a new release. Once you specify `major`, `minor`, or `patch` for the version bump strategy, the workflow will build your package with the updated version and release it on both GitHub and nuget. The included workflow in [`.github/workflows/release.yaml`](.github/workflows/publish.yaml) can be manually dispatched when you're ready to make a new release. Once you specify `major`, `minor`, or `patch` for the version bump strategy, the workflow will build your package with the updated version and release it on both GitHub and nuget.
@@ -124,7 +124,7 @@ The accompanying [`.github/workflows/auto_release.yaml`](.github/workflows/auto_
> To publish to nuget, you need to configure a repository or organization secret within GitHub named `NUGET_API_KEY` that contains your Nuget API key. Make sure you setup `NUGET_API_KEY` as a **secret** (rather than an environment variable) to keep it safe! > To publish to nuget, you need to configure a repository or organization secret within GitHub named `NUGET_API_KEY` that contains your Nuget API key. Make sure you setup `NUGET_API_KEY` as a **secret** (rather than an environment variable) to keep it safe!
### 🏚 Renovatebot ### Renovatebot
This repository includes a [`renovate.json`](./renovate.json) configuration for use with [Renovatebot]. Renovatebot can automatically open and merge pull requests to help you keep your dependencies up to date when it detects new dependency versions have been released. This repository includes a [`renovate.json`](./renovate.json) configuration for use with [Renovatebot]. Renovatebot can automatically open and merge pull requests to help you keep your dependencies up to date when it detects new dependency versions have been released.
@@ -140,7 +140,7 @@ If your project is setup to require approvals before pull requests can be merged
--- ---
🐣 Package generated from a 🐤 Chickensoft Template — <https://chickensoft.games> Package generated from a Chickensoft Template — <https://chickensoft.games>
[chickensoft-badge]: https://chickensoft.games/img/badges/chickensoft_badge.svg [chickensoft-badge]: https://chickensoft.games/img/badges/chickensoft_badge.svg
[chickensoft-website]: https://chickensoft.games [chickensoft-website]: https://chickensoft.games

View File

@@ -4,6 +4,7 @@
], ],
"ignorePaths": [ "ignorePaths": [
"**/*.tscn", "**/*.tscn",
"**/*.uid",
"**/*.import", "**/*.import",
"**/badges/**/*.*", "**/badges/**/*.*",
"**/coverage/**/*.*", "**/coverage/**/*.*",
@@ -13,6 +14,7 @@
"**/nupkg/**/*.*" "**/nupkg/**/*.*"
], ],
"words": [ "words": [
"Aabb",
"assemblyfilters", "assemblyfilters",
"automerge", "automerge",
"branchcoverage", "branchcoverage",
@@ -28,14 +30,18 @@
"endregion", "endregion",
"Finalizer", "Finalizer",
"Finalizers", "Finalizers",
"gitea",
"globaltool", "globaltool",
"godotengine", "godotengine",
"godotpackage", "godotpackage",
"issuecomment", "issuecomment",
"justalemon", "justalemon",
"Kisner",
"lcov", "lcov",
"Lerp",
"lihop", "lihop",
"linecoverage", "linecoverage",
"Mathf",
"methodcoverage", "methodcoverage",
"missingall", "missingall",
"msbuild", "msbuild",