Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions .github/workflows/dev-desktop-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ on:
type: boolean
required: true
default: "true"
steam:
description: "Generate Steam version"
type: boolean
required: true
default: "false"

env:
GODOT_VERSION: 4.6.2
GODOT_SUB: stable
GODOT_DOWNLOAD_DIR: https://github.com/godotengine/godot-builds/releases/download/4.6.2-stable
EXPORT_NAME: material_maker
MM_RELEASE: 1_6
EXPORT_TARGET_SUFFIX: "${{ github.event.inputs.steam == 'true' && ' Steam' || '' }}"
PACKAGE_SUFFIX: "${{ github.event.inputs.steam == 'true' && '_steam' || '' }}"

jobs:
export_windows_linux:
Expand Down Expand Up @@ -51,10 +58,10 @@ jobs:
docs-folder: "material_maker/doc"
- name: Windows Build 🗔
run: |
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Windows" ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/$EXPORT_NAME.exe
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Windows${EXPORT_TARGET_SUFFIX}" ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/$EXPORT_NAME.exe
- name: Linux Build 🐧
run: |
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Linux/X11" ./build/${EXPORT_NAME}_${MM_RELEASE}_linux/$EXPORT_NAME.x86_64
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Linux/X11${EXPORT_TARGET_SUFFIX}" ./build/${EXPORT_NAME}_${MM_RELEASE}_linux/$EXPORT_NAME.x86_64
- name: Copy Material Maker data 📁
run: |
cp -R ./addons/material_maker/nodes ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
Expand All @@ -74,8 +81,8 @@ jobs:
- name: Create archives 📁
run: |
cd build
zip -r ${EXPORT_NAME}_${MM_RELEASE}_windows.zip ${EXPORT_NAME}_${MM_RELEASE}_windows
tar zcvf ${EXPORT_NAME}_${MM_RELEASE}_linux.tar.gz ${EXPORT_NAME}_${MM_RELEASE}_linux
zip -r ${EXPORT_NAME}_${MM_RELEASE}_windows${PACKAGE_SUFFIX}.zip ${EXPORT_NAME}_${MM_RELEASE}_windows
tar zcvf ${EXPORT_NAME}_${MM_RELEASE}_linux${PACKAGE_SUFFIX}.tar.gz ${EXPORT_NAME}_${MM_RELEASE}_linux
- name: Upload Documentation 🚀
if: ${{ github.event.inputs.gen_doc == 'true' }}
uses: actions/upload-artifact@v6
Expand All @@ -86,12 +93,12 @@ jobs:
uses: actions/upload-artifact@v6
with:
name: windows_snapshot
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_windows.zip
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_windows${{ env.PACKAGE_SUFFIX }}.zip
- name: Upload Linux Artifact 🚀
uses: actions/upload-artifact@v6
with:
name: linux_snapshot
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_linux.tar.gz
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_linux${{ env.PACKAGE_SUFFIX }}.tar.gz
export-mac:
name: Mac Export 🍎
needs: export_windows_linux
Expand Down Expand Up @@ -148,7 +155,7 @@ jobs:
chown runner Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
mkdir -v -p ./build/mac
Godot.app/Contents/MacOS/Godot --headless -v --export-release "Mac OSX" ./build/mac/material_maker.zip
Godot.app/Contents/MacOS/Godot --headless -v --export-release "Mac OSX${EXPORT_TARGET_SUFFIX}" ./build/mac/material_maker.zip
- name: Make application executable 🔧
run: |
unzip -a ./build/mac/material_maker.zip -d ./build/mac
Expand Down Expand Up @@ -176,28 +183,37 @@ jobs:
- name: Signing ✍️
if: ${{ github.event.inputs.sign_macos == 'true' }}
run: |
codesign -s "Rodolphe Suescun" --force --options runtime --timestamp --deep "./build/mac/Material Maker.app"
codesign -s "Rodolphe Suescun" --force --timestamp --deep "./build/mac/Material Maker.app"
- name: Create DMG archive 🔧
if: ${{ github.event.inputs.steam == 'false' }}
run: |
brew update && brew install imagemagick@6
cp ./.github/workflows/create-dmg-bg.sh .
chmod +x create-dmg-bg.sh
./create-dmg-bg.sh ./splash_screen/backgrounds/pavel_oliva_vintage_luggage.png ./bg.png
#hdiutil create -srcfolder ./build/mac -fs HFS+ -volname material_maker material_maker_${{ env.MM_RELEASE }}.dmg
#hdiutil create -srcfolder ./build/mac -fs HFS+ -volname material_maker material_maker_${MM_RELEASE}${PACKAGE_SUFFIX}.dmg
wget https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.2.2.zip
unzip v1.2.2.zip
create-dmg-1.2.2/create-dmg --volname "Material Maker" --icon-size 128 --background ./bg.png --window-size 540 330 --icon "Material Maker.app" 158 125 --app-drop-link 384 125 --hide-extension "Material Maker.app" ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg ./build/mac
create-dmg-1.2.2/create-dmg --volname "Material Maker" --icon-size 128 --background ./bg.png --window-size 540 330 --icon "Material Maker.app" 158 125 --app-drop-link 384 125 --hide-extension "Material Maker.app" ./build/mac/material_maker_${MM_RELEASE}${PACKAGE_SUFFIX}.dmg ./build/mac
ls
- name: Notarizing ✍️
if: ${{ github.event.inputs.sign_macos == 'true' }}
if: ${{ github.event.inputs.steam == 'false' && github.event.inputs.sign_macos == 'true' }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
NOTARYTOOL_APP_PASSWORD: ${{ secrets.NOTARYTOOL_APP_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
xcrun notarytool submit ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg --apple-id $APPLE_ID --password $NOTARYTOOL_APP_PASSWORD --team-id $APPLE_TEAM_ID --wait
xcrun stapler staple ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg
xcrun notarytool submit ./build/mac/material_maker_${MM_RELEASE}${PACKAGE_SUFFIX}.dmg --apple-id $APPLE_ID --password $NOTARYTOOL_APP_PASSWORD --team-id $APPLE_TEAM_ID --wait
xcrun stapler staple ./build/mac/material_maker_${MM_RELEASE}${PACKAGE_SUFFIX}.dmg
- name: Upload Mac OSX Artifact 🚀
if: ${{ github.event.inputs.steam == 'false' }}
uses: actions/upload-artifact@v6
with:
name: macos_snapshot
path: ./build/mac/material_maker_${{ env.MM_RELEASE }}${{ env.PACKAGE_SUFFIX }}.dmg
- name: Upload Mac OSX Artifact (Steam) 🚀
if: ${{ github.event.inputs.steam == 'true' }}
uses: actions/upload-artifact@v6
with:
name: macos_snapshot
path: ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg
path: ./build/mac
22 changes: 22 additions & 0 deletions addons/godotsteam/godotsteam.gdextension
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[configuration]
entry_symbol = "godotsteam_init"
compatibility_minimum = "4.4"

[libraries]
macos.debug = "res://addons/godotsteam/osx/libgodotsteam.macos.template_debug.dylib"
macos.release = "res://addons/godotsteam/osx/libgodotsteam.macos.template_release.dylib"
windows.debug.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_debug.x86_64.dll"
windows.debug.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_debug.x86_32.dll"
windows.release.x86_64 = "res://addons/godotsteam/win64/libgodotsteam.windows.template_release.x86_64.dll"
windows.release.x86_32 = "res://addons/godotsteam/win32/libgodotsteam.windows.template_release.x86_32.dll"
linux.debug.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_debug.x86_64.so"
linux.debug.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_debug.x86_32.so"
linux.release.x86_64 = "res://addons/godotsteam/linux64/libgodotsteam.linux.template_release.x86_64.so"
linux.release.x86_32 = "res://addons/godotsteam/linux32/libgodotsteam.linux.template_release.x86_32.so"

[dependencies]
macos.universal = { "res://addons/godotsteam/osx/libsteam_api.dylib": "" }
windows.x86_64 = { "res://addons/godotsteam/win64/steam_api64.dll": "" }
windows.x86_32 = { "res://addons/godotsteam/win32/steam_api.dll": "" }
linux.x86_64 = { "res://addons/godotsteam/linux64/libsteam_api.so": "" }
linux.x86_32 = { "res://addons/godotsteam/linux32/libsteam_api.so": "" }
1 change: 1 addition & 0 deletions addons/godotsteam/godotsteam.gdextension.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://hydddmx8ns40
23 changes: 23 additions & 0 deletions addons/godotsteam/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2015-Current | GP Garcia, Chris Ridenour, and Contributors

View all contributors at https://godotsteam.com/contribute/contributors/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file added addons/godotsteam/linux32/libsteam_api.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added addons/godotsteam/linux64/libsteam_api.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added addons/godotsteam/osx/libsteam_api.dylib
Binary file not shown.
95 changes: 95 additions & 0 deletions addons/godotsteam/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# GodotSteam for GDExtension | Community Edition
An ecosystem of tools for [Godot Engine](https://godotengine.org) and [Valve's Steam](https://store.steampowered.com). For the Windows, Linux, and Mac platforms.


Additional Flavors
---
Standard Module | Standard Plug-ins | Server Module | Server Plug-ins | Examples
--- | --- | --- | --- | ---
[Godot 2.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot2) | [GDNative](https://codeberg.org/godotsteam/godotsteam/src/branch/gdnative) | [Server 3.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot3) | [GDNative](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdnative) | [Skillet](https://codeberg.org/godotsteam/skillet)
[Godot 3.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot3) | [GDExtension](https://codeberg.org/godotsteam/godotsteam/src/branch/gdextension) | [Server 4.x](https://codeberg.org/godotsteam/godotsteam-server/src/branch/godot4) | [GDExtension](https://codeberg.org/godotsteam/godotsteam-server/src/branch/gdextension) | ---
[Godot 4.x](https://codeberg.org/godotsteam/godotsteam/src/branch/godot4) | --- | --- | --- | ---
[MultiplayerPeer](https://codeberg.org/godotsteam/multiplayerpeer)| --- | --- | --- | ---


Documentation
---
[Documentation is available here](https://godotsteam.com/). You can also check out the Search Help section inside Godot Engine. [To start, try checking out our tutorial on initializing Steam.](https://godotsteam.com/tutorials/initializing/) There are additional tutorials, with more in the works. You can also [check out additional Godot and Steam related videos, text, additional tools, plug-ins, etc. here.](https://godotsteam.com/resources/external/)

Feel free to chat with us about GodotSteam or ask for assistance on the [Discord server](https://discord.gg/SJRSq6K).


Donate
---
Pull-requests are the best way to help the project out but you can also donate through [Github Sponsors](https://github.com/sponsors/Gramps) or [LiberaPay](https://liberapay.com/godotsteam/donate)! [You can read more about donor perks here.](https://godotsteam.com/contribute/donations/) [You can also view all our awesome donors here.](https://godotsteam.com/contribute/donors/)


Current Build
---
You can [download pre-compiled versions of this repo here](https://codeberg.org/godotsteam/godotsteam/releases).

**Version 4.17 Changes**
- Added: new enums to Result, HTTPStatusCode, RemotePlayScanCode, ActionOrigin per Steam SDK 1.63
- Added: `getDecompressedVoice()` as custom function to wrap up `getVoice()` and `decompressVoice()` in C++
- Added: missing HTMLMouseCursor enum binds
- Changed: converted functions entirely over to the Flat API system
- Changed: `activateGameOverlayInviteDialog()` changed argument name from steam_id to lobby_id for clarity
- Changed: renamed some minor parameters
- Changed: `getAPICallFailureReason()` now returns enum instead of string
- Changed: error messages if Steam is not initialized or classes are missing
- Fixed: `initFilterText()` now takes filter options
- Fixed: `sendMessages()` not compiling correctly
- Fixed: VOICE_RESULT_NO_DATA incorrectly named VOICE_RESULT_NO_DATE
- Removed: GameSearch and Music Remote classes, constants, enums per Steam SDK 1.63

[You can read more change-logs here](https://godotsteam.com/changelog/gdextension/).


Compatibility
---
While rare, sometimes Steamworks SDK updates will break compatilibity with older GodotSteam versions. Any compatability breaks are noted below. Newer API files (dll, so, dylib) _should_ still work for older versions.

Steamworks SDK Version | GodotSteam Version
---|---
1.63 or newer | 4.17
1.62 | 4.14 or 4.16.2
1.61 | 4.12 to 4.13
1.60 | 4.6 to 4.11
1.59 | 4.6 to 4.8
1.58a or older | 4.5.4 or older

Versions of GodotSteam that have compatibility breaks introduced.

GodotSteam Version | Broken Compatibility
---|---
4.8 | Networking identity system removed, replaced with Steam IDs
4.9 | sendMessages returns an Array
4.11 | setLeaderboardDetailsMax removed
4.13 | getItemDefinitionProperty return a dictionary, html_needs_paint key 'bgra' changed to 'rbga'
4.14 | Removed first argument for stat request in steamInit and steamInitEx, steamInit returns intended bool value
4.16 | Variety of small break points, refer to [4.16 changelog for details](https://godotsteam.com/changelog/godot4/)


Known Issues
---
- GDExtension for 4.1 is **not** compatible with 4.0.3 or lower. Please check the versions you are using.
- Overlay will not work in the editor but will work in export projects when uploaded to Steam. This seems to a limitation with Vulkan currently.


Quick How-To
---
For complete instructions on how to build the GDExtension version of GodotSteam, [please refer to our documentation's 'How-To GDExtension' section.](https://godotsteam.com/howto/gdextension/) It will have the most up-to-date information.

Alternatively, you can just [download the pre-compiled versions in our Releases section](https://codeberg.org/godotsteam/godotsteam/releases) or [from the Godot Asset Library](https://godotengine.org/asset-library/asset/2445) and skip compiling it yourself!


Usage
---
Do not use the GDExtension version of GodotSteam with any of the module versions whether it be our pre-compiled versions or ones you compile. They are not compatible with each other.

When exporting with the GDExtension version, please use the normal Godot Engine templates instead of our GodotSteam templates or you will have a lot of issues.


License
---
MIT license
Binary file not shown.
Binary file not shown.
Binary file added addons/godotsteam/win32/steam_api.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added addons/godotsteam/win64/steam_api64.dll
Binary file not shown.
432 changes: 414 additions & 18 deletions export_presets.cfg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material_maker/panels/graph_edit/graph_edit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ func on_connect_node(from : String, from_slot : int, to : String, to_slot : int)
for n in [ from_node, to_node ]:
if n.has_method("on_connections_changed"):
n.on_connections_changed()
mm_steam.increase_stat("stat_connections")

func do_disconnect_node(from : String, from_slot : int, to : String, to_slot : int) -> bool:
var from_node : MMGraphNodeMinimal = get_node(from)
Expand Down
77 changes: 77 additions & 0 deletions material_maker/steam.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
extends Node


@onready var steam_api
var is_subscribed : bool = false
var avatar_texture : ImageTexture
var got_avatar : bool = false


signal avatar_ready()


func _ready():
if not Engine.has_singleton("Steam"):
return
steam_api = Engine.get_singleton("Steam")
var initialize_response: Dictionary = steam_api.steamInitEx()
print("Did Steam initialize?: %s " % initialize_response)
steam_api.initAuthentication()
is_subscribed = steam_api.isSubscribed()
#steam_api.avatar_loaded.connect(self._on_avatar_loaded)
#steam_api.getPlayerAvatar()
#steam_api.connect("leaderboard_find_result", self, "_on_leaderboard_find_result")
#steam_api.connect("leaderboard_score_uploaded", self, "_on_leaderboard_score_uploaded")
#steam_api.connect("leaderboard_scores_downloaded", self, "_on_leaderboard_scores_downloaded")
#steam_api.findLeaderboard("Node count")

func is_owned() -> bool:
return is_subscribed

func get_user_name() -> String:
if not is_subscribed:
return ""
return steam_api.getPersonaName()

func get_avatar_texture() -> ImageTexture:
if not is_subscribed:
return null
if not got_avatar:
steam_api.avatar_loaded.connect(self._on_avatar_loaded)
steam_api.getPlayerAvatar()
await avatar_ready
return avatar_texture

func _on_avatar_loaded(user_id: int, avatar_size: int, avatar_buffer: PackedByteArray) -> void:
# Create the image and texture for loading
var avatar_image: Image = Image.create_from_data(avatar_size, avatar_size, false, Image.FORMAT_RGBA8, avatar_buffer)

# Optionally resize the image if it is too large
if avatar_size > 128:
avatar_image.resize(128, 128, Image.INTERPOLATE_LANCZOS)

# Apply the image to a texture
avatar_texture = ImageTexture.create_from_image(avatar_image)

avatar_ready.emit()

func is_achievement_unlocked(achievement : String) -> bool:
if not is_subscribed:
return false
var achievement_status : Dictionary = steam_api.getAchievement(achievement)
if not achievement_status.ret:
print("Achievement ", achievement, " does not exist.")
return false
return steam_api.getAchievement(achievement).achieved

func unlock_achievement(achievement : String):
if not is_subscribed:
return
steam_api.setAchievement(achievement)

func increase_stat(stat : String):
if not is_subscribed:
return
var stat_value = steam_api.getStatInt(stat)
print(stat_value)
steam_api.setStatInt(stat, stat_value+1)
1 change: 1 addition & 0 deletions material_maker/steam.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cw1nwcmq4dtki
4 changes: 4 additions & 0 deletions material_maker/windows/about/about.gd
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func _ready() -> void:
else:
application_name_label.text = ProjectSettings.get_setting("application/config/name")+" v"+ProjectSettings.get_setting("application/config/actual_release")

if mm_steam.steam_api == null:
$HBoxContainer/MarginContainer/SocialNetworks/ItchIo.visible = true
$HBoxContainer/MarginContainer/SocialNetworks/Patreon.visible = true

# Contributors list
var label : Label
for c in CONTRIBUTORS:
Expand Down
2 changes: 2 additions & 0 deletions material_maker/windows/about/about.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ layout_mode = 2

[node name="Patreon" type="TextureButton" parent="HBoxContainer/MarginContainer/SocialNetworks"]
material = SubResource("ShaderMaterial_y717h")
visible = false
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 4
Expand All @@ -220,6 +221,7 @@ texture_normal = SubResource("PlaceholderTexture2D_71vq8")
stretch_mode = 5

[node name="ItchIo" type="TextureButton" parent="HBoxContainer/MarginContainer/SocialNetworks"]
visible = false
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 4
Expand Down
Loading