Skip to content

Commit

Permalink
videoproject
Browse files Browse the repository at this point in the history
  • Loading branch information
trevyn committed Aug 15, 2024
1 parent 6ccc7bb commit 1e34065
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 2,368 deletions.
81 changes: 15 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,38 @@ on:
workflow_dispatch:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
# schedule: [cron: "40 1 * * *"]

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
# 1.60
STEAMWORKS_COMMIT: e7bb839178fc5a48aa380d85e2ad04cc97d9d11c
GODOT_VERSION: 4.3-stable

jobs:
assign:
name: assign build_id
publish:
runs-on: ubuntu-latest

steps:
- run: wget https://github.com/trevyn/animal-time/releases/latest/download/animal-time
- run: chmod +x animal-time
- run: ./animal-time > build_id
- run: cat build_id

- uses: actions/upload-artifact@v4
with:
name: build_id
path: build_id

build:
needs: [assign]
name: build rust ${{ matrix.rust }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [nightly]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4

- run: cat build_id/build_id

- run: echo "BUILD_ID=$(cat build_id/build_id)" >> $GITHUB_ENV

- run: rustup default ${{ matrix.rust }} && rustup update ${{ matrix.rust }}

- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libasound2-dev
if: ${{ matrix.os == 'ubuntu-latest' }}

- run: cargo build --release

- run: ls
- run: ls
working-directory: target
- run: ls
working-directory: target/release

# - run: mv target/release/soto soto
# if: ${{ matrix.os != 'windows-latest' }}

- run: mv target/release/soto.exe Godottest.exe
if: ${{ matrix.os == 'windows-latest' }}
- run: ls Godottest
- run: ls Godottest/res

- uses: actions/upload-artifact@v4
if: ${{ matrix.rust == 'nightly' && matrix.os == 'windows-latest' }}
- name: checkout media
uses: actions/checkout@v4
with:
name: Godottest
path: Godottest.exe
if-no-files-found: error
repository: trevyn/media
token: ${{ secrets.MEDIA_TOKEN }}
path: Godottest/res/media

publish:
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: ls Godottest/res/media

- run: curl -L -o steamworks.tar.gz https://github.com/rlabrecque/SteamworksSDK/archive/${{env.STEAMWORKS_COMMIT}}.tar.gz
- run: tar xzf steamworks.tar.gz SteamworksSDK-${{env.STEAMWORKS_COMMIT}}/redistributable_bin/win64/steam_api64.dll
- run: cp SteamworksSDK-${{env.STEAMWORKS_COMMIT}}/redistributable_bin/win64/steam_api64.dll Godottest/
- run: curl -o templates.zip -L https://github.com/godotengine/godot-builds/releases/download/${{env.GODOT_VERSION}}/Godot_v${{env.GODOT_VERSION}}_export_templates.tpz
- run: unzip templates.zip templates/windows_release_x86_64.exe
- run: mv templates/windows_release_x86_64.exe Godottest/Godottest.exe

- name: install steamcmd
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ android/
.vscode/
addons/
Cargo.lock
steam_appid.txt
steam_appid.txt
*/res/media/
38 changes: 0 additions & 38 deletions Cargo.toml

This file was deleted.

21 changes: 21 additions & 0 deletions Godottest/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=5

[application]

config/name="videoproject"
run/main_scene="res://res/node_2d.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
boot_splash/show_image=false

[display]

window/size/viewport_width=1280
window/size/viewport_height=768
9 changes: 9 additions & 0 deletions Godottest/res/audio_bus_layout.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://ccj2kbmi8vi2x"]

[resource]
bus/1/name = &"muted"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = -80.0
bus/1/send = &"Master"
75 changes: 75 additions & 0 deletions Godottest/res/node_2d.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[gd_scene load_steps=6 format=3 uid="uid://pdkn35rn7rts"]

[ext_resource type="VideoStream" path="res://res/media/output.ogv" id="1_r13cb"]
[ext_resource type="Script" path="res://res/video_stream_player.gd" id="2_76rnb"]

[sub_resource type="Theme" id="Theme_pqtiu"]
default_font_size = 36

[sub_resource type="FontVariation" id="FontVariation_1deny"]
spacing_glyph = -3

[sub_resource type="Theme" id="Theme_norqa"]
default_font = SubResource("FontVariation_1deny")
default_font_size = 55

[node name="Node2D" type="Node2D"]

[node name="ColorRect" type="ColorRect" parent="."]
offset_right = 1471.0
offset_bottom = 824.0
color = Color(0, 0, 0, 1)

[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."]
offset_right = 1280.0
offset_bottom = 768.0
stream = ExtResource("1_r13cb")
volume_db = -80.0
autoplay = true
loop = true
script = ExtResource("2_76rnb")

[node name="Label" type="Label" parent="."]
offset_left = 724.0
offset_top = 374.0
offset_right = 956.0
offset_bottom = 424.0
theme = SubResource("Theme_pqtiu")
text = "⇒ New Game"
horizontal_alignment = 2

[node name="Label4" type="Label" parent="."]
offset_left = 767.0
offset_top = 326.0
offset_right = 957.0
offset_bottom = 376.0
theme = SubResource("Theme_pqtiu")
text = "Continue"
horizontal_alignment = 2

[node name="Label5" type="Label" parent="."]
offset_left = 444.0
offset_top = 87.0
offset_right = 962.0
offset_bottom = 186.0
theme = SubResource("Theme_norqa")
text = "dungeon game"
horizontal_alignment = 2

[node name="Label2" type="Label" parent="."]
offset_left = 766.0
offset_top = 423.0
offset_right = 956.0
offset_bottom = 473.0
theme = SubResource("Theme_pqtiu")
text = "Settings"
horizontal_alignment = 2

[node name="Label3" type="Label" parent="."]
offset_left = 763.0
offset_top = 473.0
offset_right = 953.0
offset_bottom = 523.0
theme = SubResource("Theme_pqtiu")
text = "Exit"
horizontal_alignment = 2
14 changes: 14 additions & 0 deletions Godottest/res/video_stream_player.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends VideoStreamPlayer

var fade_direction = 0.02

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
#modulate.a+=fade_direction
if modulate.a > 1.0 || modulate.a < 0.0: fade_direction=-fade_direction
pass
Loading

0 comments on commit 1e34065

Please sign in to comment.