2024-07-20 09:49:49 +02:00
|
|
|
class_name Game
|
2024-07-09 22:33:38 +02:00
|
|
|
extends Node3D
|
|
|
|
|
|
|
|
@onready var message_container:Control = %MessagesContainer
|
|
|
|
@onready var message_textedit:TextEdit = %MessageTextEdit
|
2024-07-20 11:20:18 +02:00
|
|
|
|
|
|
|
@onready var player = %Player
|
|
|
|
|
|
|
|
@onready var root_ui:RootUI = %RootUI
|
|
|
|
|
|
|
|
func save_game():
|
|
|
|
var save_game:SaveGame = SaveGame.new()
|
|
|
|
|
|
|
|
save_game.player_transform = player.global_transform
|
|
|
|
|
|
|
|
ResourceSaver.save(save_game, "user://savegame.tres")
|
|
|
|
root_ui.activate_ui_panel(%GameUI)
|
|
|
|
|
|
|
|
func load_game():
|
|
|
|
var save_game:SaveGame = load("user://savegame.tres") as SaveGame
|
|
|
|
|
|
|
|
player.global_transform = save_game.player_transform
|
|
|
|
|
|
|
|
root_ui.activate_ui_panel(%GameUI)
|