-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorld.gd
More file actions
77 lines (60 loc) · 1.88 KB
/
World.gd
File metadata and controls
77 lines (60 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
extends Node3D
@onready var Options = $CanvasLayer
@onready var map = $SubViewportContainer
@onready var Skipper = $Skipper
@onready var vhs = $CanvasLayer/vhs
@export var pad_1: StaticBody3D
@export var hidden :Array[RigidBody3D]
@onready var Sun: DirectionalLight3D = $DirectionalLight3D
@onready var world_environment: WorldEnvironment = $WorldEnvironment
var config_
var menuOpen = false
var world
func _enter_tree() -> void:
load_()
Globals.Tutorial = config_.TutorialOnLaunch
func _ready() -> void:
world_environment.environment.sky_rotation = Vector3(0,70.6,41.3)
randomize()
if false:# randi_range(1,20) == 1:
Sun.visible == false
world_environment.environment.sky_rotation = Vector3(0,70.6,-41.3)
else:
Sun.visible == true
world_environment.environment.sky_rotation = Vector3(0,70.6,41.3)
return
#test_()
func save_ ():
for action in InputMap.get_actions():
config_.input_map[action] = InputMap.action_get_events(action)
ResourceSaver.save(config_, "user://config.tres")
Skipper.updateSettings()
vhs.visible = config_.vhs
func load_():
config_ = load("user://config.tres")
if not config_:
config_ = Config.new()
config_.TutorialOnLaunch = true
for action in config_.input_map:
InputMap.action_erase_events(action)
for input_event in config_.input_map[action]:
InputMap.action_add_event(action, input_event)
func _input(event):
#if event is InputEventKey and Input.is_action_just_pressed("options menu"):
# MenuToggle()
if event is InputEventKey and Input.is_action_just_pressed("map"):
map.visible = !map.visible
func MenuToggle():
vhs.visible = config_.vhs
Options.visible = !Options.visible
menuOpen = !menuOpen
get_tree().paused = !get_tree().paused
func test_():
config_.volume = 0.5
save_()
OS.shell_open(ProjectSettings.globalize_path("user://"))
func unHide():
for item in hidden:
item.reparent(pad_1)
item.reReady()
pad_1.newItems()