Skip to content

Commit

Permalink
Merge pull request #5 from ARKANYOTA/steam-api
Browse files Browse the repository at this point in the history
Steam API
  • Loading branch information
Yolwoocle authored Sep 11, 2024
2 parents afce310 + 2831a1f commit 4225d1f
Show file tree
Hide file tree
Showing 36 changed files with 410 additions and 91 deletions.
21 changes: 21 additions & 0 deletions src/addons/godotsteam/godotsteam.gdextension
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[configuration]
entry_symbol = "godotsteam_init"
compatibility_minimum = "4.1"

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

[dependencies]
windows.x86_64 = { "win64/steam_api64.dll": "" }
windows.x86_32 = { "win32/steam_api.dll": "" }
linux.x86_64 = { "linux64/libsteam_api.so": "" }
linux.x86_32 = { "linux32/libsteam_api.so": "" }
Binary file not shown.
Binary file not shown.
Binary file added src/addons/godotsteam/linux32/libsteam_api.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/addons/godotsteam/linux64/libsteam_api.so
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>libgodotsteam.debug</string>
<key>CFBundleIdentifier</key>
<string>org.coaguco.godotsteam</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgodotsteam.debug</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.5.2</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>4.5.2</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>libgodotsteam</string>
<key>CFBundleIdentifier</key>
<string>org.coaguco.godotsteam</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgodotsteam</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.5.2</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>4.5.2</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file added src/addons/godotsteam/osx/libsteam_api.dylib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/addons/godotsteam/win32/steam_api.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/addons/godotsteam/win64/steam_api64.dll
Binary file not shown.
Binary file not shown.
7 changes: 4 additions & 3 deletions src/assets/resources/label_warning.tres
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://b5nxegdlm352f"]

[ext_resource type="FontFile" uid="uid://djmgql28si3cf" path="res://assets/fonts/font_normal.ttf" id="1_kvt47"]
[ext_resource type="FontFile" uid="uid://cjyup1ooil314" path="res://assets/fonts/font_normal.ttf" id="1_kvt47"]

[resource]
font = ExtResource("1_kvt47")
font_size = 10
font_color = Color(1, 0, 0, 1)
font_size = 4
outline_size = 2
outline_color = Color(0, 0, 0, 1)
2 changes: 1 addition & 1 deletion src/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ advanced_options=true
dedicated_server=false
custom_features=""
export_filter="exclude"
export_files=PackedStringArray("res://addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension", "res://addons/discord-rpc-gd/nodes/assets/Checked.svg", "res://addons/discord-rpc-gd/nodes/assets/circle.svg", "res://addons/discord-rpc-gd/nodes/assets/Unchecked.svg", "res://addons/discord-rpc-gd/nodes/debug.gd", "res://addons/discord-rpc-gd/nodes/Debug.tscn", "res://addons/discord-rpc-gd/nodes/discord_autoload.gd", "res://addons/discord-rpc-gd/Debug.svg", "res://addons/discord-rpc-gd/example.gd", "res://addons/discord-rpc-gd/logo.png", "res://addons/discord-rpc-gd/Logo_V2_No_Bg.png", "res://addons/discord-rpc-gd/plugin.gd", "res://addons/discord-rpc-gd/restart_window.tscn")
export_files=PackedStringArray("res://addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension", "res://addons/discord-rpc-gd/nodes/assets/Checked.svg", "res://addons/discord-rpc-gd/nodes/assets/circle.svg", "res://addons/discord-rpc-gd/nodes/assets/Unchecked.svg", "res://addons/discord-rpc-gd/nodes/debug.gd", "res://addons/discord-rpc-gd/nodes/Debug.tscn", "res://addons/discord-rpc-gd/nodes/discord_autoload.gd", "res://addons/discord-rpc-gd/Debug.svg", "res://addons/discord-rpc-gd/example.gd", "res://addons/discord-rpc-gd/logo.png", "res://addons/discord-rpc-gd/Logo_V2_No_Bg.png", "res://addons/discord-rpc-gd/plugin.gd", "res://addons/discord-rpc-gd/restart_window.tscn", "res://addons/godotsteam/godotsteam.gdextension")
include_filter=""
exclude_filter=""
export_path="../output/globs_v1_1_dev_24-09-10c.apk"
Expand Down
14 changes: 13 additions & 1 deletion src/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ config/icon="res://assets/images/icon_big.png"

[autoload]

GameManager="*res://scripts/autoload/game_manager.gd"
SceneTransitionAutoLoad="*res://scripts/autoload/scene_transition_auto_load.gd"
LevelData="*res://scripts/autoload/level_data.gd"
PauseMenuAutoload="*res://scripts/autoload/pause_menu_autoload.gd"
BlockManagerAutoload="*res://scripts/autoload/block_manager_autoload.gd"
GameManager="*res://scripts/autoload/game_manager.gd"
Util="*res://scripts/autoload/util.gd"
MusicManager="*res://scripts/autoload/music_manager.gd"
DiscordRPCLoader="*res://addons/discord-rpc-gd/nodes/discord_autoload.gd"

[debug]

file_logging/enable_file_logging=true
gdscript/warnings/unused_variable=0
gdscript/warnings/unused_private_class_variable=0
gdscript/warnings/unused_parameter=0
Expand All @@ -63,6 +64,7 @@ enabled=PackedStringArray("res://addons/discord-rpc-gd/plugin.cfg")
[file_customization]

folder_colors={
"res://addons/": "gray",
"res://assets/": "green",
"res://scenes/": "blue",
"res://scripts/": "yellow",
Expand Down Expand Up @@ -151,6 +153,16 @@ toggle_gui={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
removeme_achievement_test={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":38,"location":0,"echo":false,"script":null)
]
}
removeme_achievement_revokeall={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":233,"location":0,"echo":false,"script":null)
]
}

[layer_names]

Expand Down
6 changes: 6 additions & 0 deletions src/scenes/achievements/achievement_manager.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://clch7rqviicn6"]

[ext_resource type="Script" path="res://scripts/achievements/achievement_manager.gd" id="1_m7vyf"]

[node name="AchievementManager" type="Node"]
script = ExtResource("1_m7vyf")
7 changes: 7 additions & 0 deletions src/scenes/achievements/achievement_manager_steam.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://faky8wdeat6a"]

[ext_resource type="PackedScene" uid="uid://clch7rqviicn6" path="res://scenes/achievements/achievement_manager.tscn" id="1_cw8f3"]
[ext_resource type="Script" path="res://scripts/achievements/achievement_manager_steam.gd" id="2_ifq44"]

[node name="AchievementManagerSteam" instance=ExtResource("1_cw8f3")]
script = ExtResource("2_ifq44")
1 change: 1 addition & 0 deletions src/scenes/integration/discord_rich_presence.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
[ext_resource type="Script" path="res://scripts/integration/discord_rich_presence.gd" id="1_ybopi"]

[node name="DiscordRichPresence" type="Node"]
process_mode = 3
script = ExtResource("1_ybopi")
7 changes: 7 additions & 0 deletions src/scenes/integration/steam_interface.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://c631vn0vdu25v"]

[ext_resource type="Script" path="res://scripts/integration/steam_interface.gd" id="1_i0mro"]

[node name="SteamInterface" type="Node"]
process_mode = 3
script = ExtResource("1_i0mro")
35 changes: 10 additions & 25 deletions src/scenes/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://clib81weo65vk"]
[gd_scene load_steps=12 format=3 uid="uid://clib81weo65vk"]

[ext_resource type="Script" path="res://scripts/main.gd" id="1_ngeyx"]
[ext_resource type="PackedScene" uid="uid://bpqekaydn06nf" path="res://scenes/ui/scene_transition.tscn" id="4_mholn"]
Expand All @@ -12,7 +12,7 @@

[sub_resource type="LabelSettings" id="LabelSettings_u3bde"]
font = ExtResource("5_v4ddl")
font_size = 4
font_size = 5
font_color = Color(0.878098, 0.878098, 0.878098, 1)
outline_size = 2
outline_color = Color(0, 0, 0, 1)
Expand All @@ -23,19 +23,6 @@ font_size = 8
outline_size = 2
outline_color = Color(0, 0, 0, 1)

[sub_resource type="Gradient" id="Gradient_bgniq"]
colors = PackedColorArray(0.966052, 0.966052, 5.39064e-06, 1, 0.869317, 0.869318, 3.85046e-07, 1)

[sub_resource type="GradientTexture2D" id="GradientTexture2D_fjena"]
gradient = SubResource("Gradient_bgniq")

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_bdjxa"]
texture = SubResource("GradientTexture2D_fjena")
texture_margin_left = 8.0
texture_margin_top = 8.0
texture_margin_right = 8.0
texture_margin_bottom = 8.0

[node name="Main" type="Node2D"]
script = ExtResource("1_ngeyx")

Expand Down Expand Up @@ -143,22 +130,20 @@ grow_vertical = 2
texture = ExtResource("8_53ti5")

[node name="AppleWarn" type="Control" parent="CanvasLayer"]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="WarningApple" type="Label" parent="CanvasLayer/AppleWarn"]
layout_mode = 0
offset_left = 22.0
offset_top = 39.0
offset_right = 225.0
offset_bottom = 97.0
theme_override_styles/normal = SubResource("StyleBoxTexture_bdjxa")
text = "Warning IOS and MacOS web
version is not always
supported"
offset_left = 17.0
offset_top = 3.0
offset_right = 220.0
offset_bottom = 26.0
text = "Warning : iOS and macOS web version is not always supported"
label_settings = ExtResource("9_nsas2")
horizontal_alignment = 1
uppercase = true
script = ExtResource("7_h54yi")
color_1 = Color(1, 0.8275, 0.31, 1)
color_2 = Color(1, 0.433333, 0, 1)
104 changes: 70 additions & 34 deletions src/scenes/ui/redirect_page_to_our_games.tscn
Original file line number Diff line number Diff line change
@@ -1,40 +1,76 @@
[gd_scene load_steps=2 format=3 uid="uid://do8khq28rqe3n"]
[gd_scene load_steps=5 format=3 uid="uid://do8khq28rqe3n"]

[ext_resource type="LabelSettings" uid="uid://cl1yg37xye2ku" path="res://assets/resources/label_settings.tres" id="1_voncg"]
[ext_resource type="PackedScene" uid="uid://wmysu03x830w" path="res://scenes/levels/visuals/city_visuals.tscn" id="1_uhilt"]
[ext_resource type="Texture2D" uid="uid://b3l0i7o6emx6i" path="res://assets/images/logo.png" id="2_5nfmw"]
[ext_resource type="FontFile" uid="uid://cjyup1ooil314" path="res://assets/fonts/font_normal.ttf" id="3_mfx0u"]

[sub_resource type="LabelSettings" id="LabelSettings_7ciee"]
font = ExtResource("3_mfx0u")
font_size = 8
outline_size = 2
outline_color = Color(0, 0, 0, 1)

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

[node name="Control" type="Control" parent="."]
[node name="CityVisuals" parent="." instance=ExtResource("1_uhilt")]

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="Control" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="Label" type="Label" parent="Control"]
layout_mode = 0
offset_left = 19.0
offset_top = 23.0
offset_right = 220.0
offset_bottom = 80.0
text = "Hey man, you are on an unknown URL.
And end the demo for an unknown URL.
If you think this is a mistake,
please report it to us.
Otherwise: Please go to our URL:"
label_settings = ExtResource("1_voncg")

[node name="Yolwoocle" type="LinkButton" parent="Control"]
offset_left = 77.0
offset_top = 80.0
offset_right = 155.0
offset_bottom = 103.0
text = "Yolwoocle"
uri = "https://yolwoocle.itch.io/globs"
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Arkanyota" type="LinkButton" parent="Control"]
offset_left = 77.0
offset_top = 99.0
offset_right = 158.0
offset_bottom = 122.0
text = "ArkanYota"
uri = "https://arkanyota.github.io/gmtk2024"
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -63.0
offset_top = 11.0
offset_right = 63.0
offset_bottom = 53.0
grow_horizontal = 2
texture = ExtResource("2_5nfmw")

[node name="Label" type="Label" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -121.0
offset_top = -4.5
offset_right = 123.0
offset_bottom = 31.5
grow_horizontal = 2
grow_vertical = 2
text = "This is the end of the demo
on this website.
You can continue playing by clicking here:"
label_settings = SubResource("LabelSettings_7ciee")
horizontal_alignment = 1

[node name="Yolwoocle" type="LinkButton" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -35.0
offset_top = 38.5
offset_right = 33.0
offset_bottom = 58.5
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/outline_size = 3
theme_override_constants/underline_spacing = 5
theme_override_fonts/font = ExtResource("3_mfx0u")
theme_override_font_sizes/font_size = 0
text = "itch.io"
uri = "https://yolwoocle.itch.io/globs"
22 changes: 22 additions & 0 deletions src/scripts/achievements/achievement_manager.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends Node
class_name AchievementManager

var achievements: Dictionary = {
"ACH_TEST_01": {achieved = false, hidden = false},
}

func _init():
pass

func achievement_exists(achievement_name: String) -> bool:
return achievements.has(achievement_name)

func grant(achievement_name: String) -> bool:
return false

func revoke(achievement_name: String) -> bool:
return false

func revoke_all() -> void:
for ach in achievements:
revoke(ach)
21 changes: 21 additions & 0 deletions src/scripts/achievements/achievement_manager_steam.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends AchievementManager

func _ready():
pass


func grant(achievement_name: String) -> bool:
if not GameManager.steam_interface:
return false
if not achievement_exists(achievement_name):
return false

return GameManager.steam_interface.grant_achievement("ACH_TEST_01")

func revoke(achievement_name: String) -> bool:
if not GameManager.steam_interface:
return false
if not achievement_exists(achievement_name):
return false

return GameManager.steam_interface.revoke_achievement(achievement_name)
Loading

0 comments on commit 4225d1f

Please sign in to comment.