Skip to content

Commit

Permalink
Merge pull request #17 from Malcolmnixon/add_csharp
Browse files Browse the repository at this point in the history
Add C# version or TiltFiveTools
  • Loading branch information
Malcolmnixon authored Nov 27, 2023
2 parents 8df2eac + 290592a commit d111756
Show file tree
Hide file tree
Showing 256 changed files with 17,047 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Normalize EOL for all files that Git considers text files.
*.gd eol=lf
*.cs eol=lf
*.tscn eol=lf
*.cfg eol=lf
*.godot eol=lf
Expand Down
86 changes: 64 additions & 22 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,85 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
path: demo/tilt-five-tools
- name: Create Tilt Five Tools plugin
path: src/tilt-five-tools
- name: Assemble Tilt Five Tools Plugin (GD)
run: |
mkdir plugin
mkdir plugin/tilt-five-tools
mkdir plugin/tilt-five-tools/addons
cp -r demo/tilt-five-tools/addons/tiltfive_tools plugin/tilt-five-tools/addons
cp demo/tilt-five-tools/LICENSE plugin/tilt-five-tools/addons/tiltfive_tools
cp demo/tilt-five-tools/CONTRIBUTORS.md plugin/tilt-five-tools/addons/tiltfive_tools
cp demo/tilt-five-tools/VERSIONS.md plugin/tilt-five-tools/addons/tiltfive_tools
rm -rf demo/tilt-five-tools/.git
rm -rf demo/tilt-five-tools/.github
- name: Create Tilt Five Tools library artifact
mkdir plugin-gd
mkdir plugin-gd/tilt-five-tools
mkdir plugin-gd/tilt-five-tools/addons
cp -r src/tilt-five-tools/project.gd/addons/tiltfive_tools plugin-gd/tilt-five-tools/addons
cp src/tilt-five-tools/LICENSE plugin-gd/tilt-five-tools/addons/tiltfive_tools
cp src/tilt-five-tools/CONTRIBUTORS.md plugin-gd/tilt-five-tools/addons/tiltfive_tools
cp src/tilt-five-tools/VERSIONS.md plugin-gd/tilt-five-tools/addons/tiltfive_tools
- name: Assemble Tilt Five Tools Demo (GD)
run: |
mkdir demo-gd
mkdir demo-gd/tilt-five-tools-demo
cp -r src/tilt-five-tools/project.gd/. demo-gd/tilt-five-tools-demo
cp src/tilt-five-tools/LICENSE demo-gd/tilt-five-tools-demo
cp src/tilt-five-tools/CONTRIBUTORS.md demo-gd/tilt-five-tools-demo
cp src/tilt-five-tools/VERSIONS.md demo-gd/tilt-five-tools-demo
- name: Assemble Tilt Five Tools Plugin (C#)
run: |
mkdir plugin-csharp
mkdir plugin-csharp/tilt-five-tools
mkdir plugin-csharp/tilt-five-tools/addons
cp -r src/tilt-five-tools/project.csharp/addons/tiltfive_tools plugin-csharp/tilt-five-tools/addons
cp src/tilt-five-tools/LICENSE plugin-csharp/tilt-five-tools/addons/tiltfive_tools
cp src/tilt-five-tools/CONTRIBUTORS.md plugin-csharp/tilt-five-tools/addons/tiltfive_tools
cp src/tilt-five-tools/VERSIONS.md plugin-csharp/tilt-five-tools/addons/tiltfive_tools
- name: Assemble Tilt Five Tools Demo (C#)
run: |
mkdir demo-csharp
mkdir demo-csharp/tilt-five-tools-demo
cp -r src/tilt-five-tools/project.csharp/. demo-csharp/tilt-five-tools-demo
cp src/tilt-five-tools/LICENSE demo-csharp/tilt-five-tools-demo
cp src/tilt-five-tools/CONTRIBUTORS.md demo-csharp/tilt-five-tools-demo
cp src/tilt-five-tools/VERSIONS.md demo-csharp/tilt-five-tools-demo
- name: Create Tilt Five Tools library artifact (GD)
uses: actions/upload-artifact@v3
with:
name: tilt-five-tools-gd
path: |
plugin-gd
- name: Create Tilt Five Tools demo artifact (GD)
uses: actions/upload-artifact@v3
with:
name: tilt-five-tools
name: tilt-five-tools-demo-gd
path: |
plugin
- name: Create Tilt Five Tools demo artifact
demo-gd
- name: Create Tilt Five Tools library artifact (C#)
uses: actions/upload-artifact@v3
with:
name: tilt-five-tools-demo
name: tilt-five-tools-csharp
path: |
demo
plugin-csharp
- name: Create Tilt Five Tools demo artifact (C#)
uses: actions/upload-artifact@v3
with:
name: tilt-five-tools-demo-csharp
path: |
demo-csharp
- name: Zip asset
run: |
cd plugin
zip -qq -r ../tilt-five-tools.zip tilt-five-tools
cd ../demo
zip -qq -r ../tilt-five-tools-demo.zip tilt-five-tools
cd plugin-gd
zip -qq -r ../tilt-five-tools-gd.zip tilt-five-tools
cd ..
cd demo-gd
zip -qq -r ../tilt-five-tools-demo-gd.zip tilt-five-tools-demo
cd ..
cd plugin-csharp
zip -qq -r ../tilt-five-tools-csharp.zip tilt-five-tools
cd ..
cd demo-csharp
zip -qq -r ../tilt-five-tools-demo-csharp.zip tilt-five-tools-demo
cd ..
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "tilt-five-tools.zip,tilt-five-tools-demo.zip"
artifacts: "tilt-five-tools-gd.zip,tilt-five-tools-demo-gd.zip,tilt-five-tools-csharp.zip,tilt-five-tools-demo-csharp.zip"
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ together with the [TiltFiveGodot4](https://github.com/GodotVR/TiltFiveGodot4) pl
create Tilt Five games.


## How to Use
## Language support

The [Asset README](./addons/tiltfive_tools/README.md) contains:
- [General Concepts](./addons/tiltfive_tools/README.md#general-concepts)
- [Tool Components](./addons/tiltfive_tools/README.md#tilt-five-tool-components)
- [Frequently Asked Questions](./addons/tiltfive_tools/README.md#faq)
Tilt Five Tools has both gdscript and .NET versions with the same features.


## Demo
## How to Use (GDScript)

This repository contains a basic demo of the Tilt Five Tools features.
The [Asset README](./project.gd/addons/tiltfive_tools/README.md) contains:
- [General Concepts](./project.gd/addons/tiltfive_tools/README.md#general-concepts)
- [Tool Components](./project.gd/addons/tiltfive_tools/README.md#tilt-five-tool-components)
- [Frequently Asked Questions](./project.gd/addons/tiltfive_tools/README.md#faq)


## How to Use (.NET)

The [Asset README](./project.csharp/addons/tiltfive_tools/README.md) contains:
- [General Concepts](./project.csharp/addons/tiltfive_tools/README.md#general-concepts)
- [Tool Components](./project.csharp/addons/tiltfive_tools/README.md#tilt-five-tool-components)
- [Frequently Asked Questions](./project.csharp/addons/tiltfive_tools/README.md#faq)


## Licensing
Expand Down
7 changes: 7 additions & 0 deletions project.csharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Godot 4+ specific ignores
.godot/
.vs/
.vscode/
*.old
*.csproj
*.sln
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions project.csharp/addons/tiltfive/T5Def.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Godot;
using System;

public static class T5Def {

public enum GameboardType
{
Unknown = 1,
LE = 2,
XE = 3,
XE_Raised = 4
}

// Buttons
public static StringName WAND_BUTTON_A = "button_a";
public static StringName WAND_BUTTON_B = "button_b";
public static StringName WAND_BUTTON_X = "button_x";
public static StringName WAND_BUTTON_Y = "button_y";
public static StringName WAND_BUTTON_1 = "button_1";
public static StringName WAND_BUTTON_2 = "button_2";
public static StringName WAND_BUTTON_STICK = "button_3";
public static StringName WAND_BUTTON_T5 = "button_t5";
public static StringName WAND_BUTTON_TRIGGER = "trigger_click";
// Axis
public static StringName WAND_ANALOG_STICK = "stick";
public static StringName WAND_ANALOG_TRIGGER = "trigger";

}
Loading

0 comments on commit d111756

Please sign in to comment.