Implemented offline mode
This commit is contained in:
parent
18b20f33a5
commit
9ceaa3c649
@ -1,12 +1,18 @@
|
||||
extends Node
|
||||
|
||||
func _ready():
|
||||
%Logout.success.emit()
|
||||
# %Logout.success.emit()
|
||||
pause(true)
|
||||
|
||||
%Login.success.connect(on_login)
|
||||
%Logout.success.connect(on_logout)
|
||||
%Login.send_login()
|
||||
# %Login.send_login()
|
||||
|
||||
Global.username = "Local"
|
||||
Global.account_id = "test"
|
||||
Global.auth_token = "test"
|
||||
%Login.success.emit()
|
||||
Global.player = %PlayerAdd.spawn_player(Global.account_id)
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("toggle_fullscreen"):
|
||||
|
@ -24,7 +24,6 @@ func handle_packet(data: PackedByteArray):
|
||||
var player := spawn_player(player_id)
|
||||
player.position = server_position
|
||||
player.set_character_name(player_name)
|
||||
Global.players.add(player)
|
||||
|
||||
func spawn_player(id: String) -> Player:
|
||||
var player: Player
|
||||
@ -48,4 +47,5 @@ func spawn_player(id: String) -> Player:
|
||||
player.controller = ProxyController.new(player)
|
||||
|
||||
player.add_child(player.controller)
|
||||
Global.players.add(player)
|
||||
return player
|
||||
|
Loading…
Reference in New Issue
Block a user