-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.gd
144 lines (99 loc) · 3.84 KB
/
Main.gd
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#/*************************************************************************/#
#/* Created by Andrew Poženel, 2022 */#
#/*************************************************************************/#
extends Control
onready var bg = $background
onready var au = $audio
var time = OS.get_time(false)
var hour = time.hour
var minute = time.minute
var second = time.second
var datetime = OS.get_datetime(false)
onready var tl = $buttons/TextureButton/timeLBL
func _ready() -> void:
StartupAudio()
ShuffleWallpapers()
#CalculateCurrentDateTime()
func _exit_tree() -> void:
ShutdownAudio()
func ShuffleWallpapers():
randomize()
var wallpapers = [
preload('res://data/media/wallpapers/Ascent.jpg'),
preload('res://data/media/wallpapers/Autumn.jpg'),
preload('res://data/media/wallpapers/Azul.jpg'),
preload('res://data/media/wallpapers/Bliss.jpg'),
preload('res://data/media/wallpapers/Blue hills.jpg'),
preload('res://data/media/wallpapers/Crystal.jpg'),
preload('res://data/media/wallpapers/Follow.jpg'),
preload('res://data/media/wallpapers/Friend.jpg'),
preload('res://data/media/wallpapers/Home.jpg'),
preload('res://data/media/wallpapers/Moon flower.jpg'),
preload('res://data/media/wallpapers/Peace.jpg'),
preload('res://data/media/wallpapers/Power.jpg'),
preload('res://data/media/wallpapers/Purple flower.jpg'),
preload('res://data/media/wallpapers/Radiance.jpg'),
preload('res://data/media/wallpapers/Red moon desert.jpg'),
preload('res://data/media/wallpapers/Ripple.jpg'),
preload('res://data/media/wallpapers/Stonehenge.jpg'),
preload('res://data/media/wallpapers/Sunset.jpg'),
preload('res://data/media/wallpapers/Tulips.jpg'),
preload('res://data/media/wallpapers/Vortec space.jpg'),
preload('res://data/media/wallpapers/Water lilies.jpg'),
preload('res://data/media/wallpapers/Wind.jpg'),
preload('res://data/media/wallpapers/Windows XP.bmp'),
preload('res://data/media/wallpapers/Winter.jpg'),
]
randomize()
for wallpaper in wallpapers:
bg.set_texture(wallpapers[round(rand_range(0,23))])
#bg.set_texture(wallpapers[round(rand_range(0,23))])
# for wallpaper in wallpapers:
#
# randomize()
# wallpapers[randi() % wallpapers.size()]
#
# bg.set_texture(wallpaper)
# randomize()
func StartupAudio():
au.autoplay = false
au.set_stream(preload('res://data/media/Windows XP Startup.wav'))
au.play()
print("Start time: ")
print(String(time.hour) +":"+String(time.minute)+":"+String(time.second))
func ShutdownAudio():
au.autoplay = false
au.set_stream(preload('res://data/media/Windows XP Shutdown.wav'))
au.play()
print("Shutdown time: ")
print(String(time.hour) +":"+String(time.minute)+":"+String(time.second))
#func CalculateCurrentDateTime():
#
# print(datetime)
# print(time)
#
# tl.set_text(String(time.hour) +":"+String(time.minute)+":"+String(time.second))
#
# pass
func _on_Timer_timeout() -> void:
get_tree().change_scene("res://ShuttingDown.tscn")
func _on_Button_pressed() -> void:
$buttons/TextureButton/desktop_icons/Msgbox.set_visible(true)
func _on_OK_pressed() -> void:
get_tree().change_scene("res://ShuttingDown.tscn")
func _on_X_pressed() -> void:
$buttons/TextureButton/desktop_icons/Msgbox/X/AudioStreamPlayer.play()
$buttons/TextureButton/desktop_icons/Msgbox/X/Bsod.visible = true
$buttons/TextureButton/desktop_icons/Msgbox/X/Timer_X.start(7)
func _on_Timer_X_timeout() -> void:
get_tree().quit()
func _on_Button_mouse_entered() -> void:
hint_tooltip = "Network connection"
func _on_ButtonAU_mouse_entered() -> void:
hint_tooltip = "Volume"
func _on_ButtonHW_mouse_entered() -> void:
hint_tooltip = "Eject device"
func _on_ButtonSEC_mouse_entered() -> void:
hint_tooltip = "Unresolved actions require your attention!"
func _on_timeLBL_mouse_entered() -> void:
hint_tooltip = "Time"