Skip to content

do-not-merge: online functionality #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: nightly
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ export_presets.cfg
addons/discord_game_sdk/bin/**

.vscode/settings.json
/dist
/export
/actions
/addons/discord_game_sdk
Binary file added ico2.ico
Binary file not shown.
30 changes: 16 additions & 14 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -49,72 +49,72 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://scripts/cursordance/Directional.gd"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivity",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivityAssets",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity_assets.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivityManager",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity_manager.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivityParty",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity_party.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivitySecrets",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity_secrets.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordActivityTimestamps",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_activity_timestamps.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordCore",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_core.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordLobby",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_lobby.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordLobbyManager",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_lobby_manager.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordLobbyTransaction",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_lobby_transaction.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordOverlayManager",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_overlay_manager.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordPartySize",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_party_size.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordResult",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_result.gdns"
}, {
"base": "",
"base": "Reference",
"class": "DiscordUser",
"language": "NativeScript",
"path": "res://addons/discord_game_sdk/discord_user.gdns"
Expand Down Expand Up @@ -315,6 +315,8 @@ RQueue="*res://scripts/content/resources/ResourceQueue.gd"
Discord="*res://addons/discord_game_sdk/discord.gd"
Dance="*res://scripts/cursordance/Dance.gd"
SFXManager="*res://scripts/game/SFXManager.gd"
Socket="*res://scripts/game/Socket.gd"
OnlineDownloader="*res://scripts/game/OnlineDownloader.gd"

[debug]

Expand Down
16 changes: 16 additions & 0 deletions scenes/loaders/LoaderTextOnline.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends Label

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


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
text = "Updating Online Modules\nGame might close/restart few times\n Checking for updates"
if(OnlineDownloader.downloadProgress>0):
text = "Updating Online Modules\nGame might close/restart few times\n Prerequisites:"+ str(OnlineDownloader.downloadProgress) + "%"

if(Socket.loadingProgress>0):
text = "Updating Online Modules\nGame might close/restart few times\n Renderer Modules:"+ str(Socket.loadingProgress) + "%"
pass
72 changes: 70 additions & 2 deletions scenes/loaders/menuload.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,75 @@
[ext_resource path="res://scripts/ui/menu/VersionNumber.gd" type="Script" id=2]
[ext_resource path="res://assets/images/branding/icon.png" type="Texture" id=3]
[ext_resource path="res://uitheme.tres" type="Theme" id=4]
[ext_resource path="res://scripts/loaders/menuload.gd" type="Script" id=5]

[sub_resource type="GDScript" id=7]
script/source = "extends Node

var leaving:bool = false

var target:String = Rhythia.menu_target

var black_fade_target:bool = false
var black_fade:float = 0

func _ready():
get_tree().paused = false
if Rhythia.vr:
target = \"res://vr/vrmenu.tscn\"
Rhythia.vr_player.transform.origin = Vector3(0,0,0)
PhysicsServer.set_active(true)
Input.set_custom_mouse_cursor(null)
Input.set_default_cursor_shape(Input.CURSOR_ARROW)
Rhythia.load_color_txt()
Rhythia.conmgr_transit = null
Rhythia.loaded_world = null
Rhythia.was_replay = Rhythia.replaying
Rhythia.replaying = false
if Rhythia.was_replay: Rhythia.restore_prev_state()
if Rhythia.selected_song: Rhythia.selected_song.discard_notes()
Rhythia.replay_path = \"\"
$BlackFade.visible = true
black_fade = 1
$BlackFade.color = Color(0,0,0,black_fade)
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
var s = Globals.error_sound
var st = Rhythia.get_stream_with_default(\"user://loadingmusic\",s)
if st != s:
$Music.stream = st
$Music.play()

# $AudioStreamPlayer.play()

var res = RQueue.queue_resource(target)
if res != OK:
Rhythia.errorstr = \"queue_resource returned %s\" % res
get_tree().change_scene(\"res://scenes/errors/menuload.tscn\")

var result
var left:bool = false

func _process(delta):
# $AudioStreamPlayer.volume_db = -3 - (40*black_fade)
$Music.volume_db = -8 - (40*black_fade)
if black_fade_target && black_fade != 1:
black_fade = min(black_fade + (delta/0.3),1)
$BlackFade.color = Color(0,0,0,black_fade)
elif !black_fade_target && black_fade != 0:
black_fade = max(black_fade - (delta/0.3),0)
$BlackFade.color = Color(0,0,0,black_fade)

if !leaving:
if RQueue.is_ready(target):
result = RQueue.get_resource(target)
leaving = true
black_fade_target = true
if !(result is Object):
Rhythia.errorstr = \"get_resource returned non-object (probably null)\"
get_tree().change_scene(\"res://scenes/errors/menuload.tscn\")

if leaving and result and black_fade == 1:
get_tree().change_scene_to(result)
"

[sub_resource type="DynamicFont" id=1]
size = 48
Expand Down Expand Up @@ -50,7 +118,7 @@ pause_mode = 2
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0, 0, 0, 1 )
script = ExtResource( 5 )
script = SubResource( 7 )

[node name="Label" type="Label" parent="."]
visible = false
Expand Down
Loading