1
0
Fork 0
ExampleProject/RetroWindowsGUI/Window.tscn

440 lines
18 KiB
Plaintext

[gd_scene load_steps=23 format=3 uid="uid://bvc6sgiglgspt"]
[ext_resource type="Theme" uid="uid://c23xui480a6b6" path="res://RetroWindowsGUI/RetroWindowsTheme.tres" id="1_2cwqu"]
[ext_resource type="Script" path="res://RetroWindowsGUI/Desktop.gd" id="2_1wlr7"]
[ext_resource type="Texture2D" uid="uid://f572ckglau50" path="res://RetroWindowsGUI/Images/Windows_Icon_Minimize.png" id="2_2k613"]
[ext_resource type="Script" path="res://RetroWindowsGUI/RetroWindow.gd" id="2_5t0g8"]
[ext_resource type="Texture2D" uid="uid://bir5p8cnwtwrn" path="res://RetroWindowsGUI/Images/Windows_Icon_Maximize.png" id="3_6tl28"]
[ext_resource type="Texture2D" uid="uid://byysuusmylpjo" path="res://RetroWindowsGUI/Images/Window_Header_Inner.png" id="3_gyniv"]
[ext_resource type="Texture2D" uid="uid://bluatk0bspn3x" path="res://RetroWindowsGUI/Images/Windows_Icon_Close.png" id="4_b1wjg"]
[ext_resource type="Texture2D" uid="uid://lfo3fn4qyl3g" path="res://RetroWindowsGUI/Images/Windows_Icon_Question.png" id="6_byeim"]
[ext_resource type="Texture2D" uid="uid://dxtjm7ivsy8s1" path="res://RetroWindowsGUI/Images/Windows_Inner_Frame_Inverted.png" id="8_75uw4"]
[ext_resource type="PackedScene" uid="uid://dviuoownyvrke" path="res://thirdPerson.tscn" id="9_o80ae"]
[ext_resource type="PackedScene" uid="uid://bedj3x7821sbp" path="res://RetroWindowsGUI/DesktopWindow.tscn" id="11_m0w0q"]
[ext_resource type="AudioStream" uid="uid://c51m7ngf7kjdq" path="res://RetroWindowsGUI/me.ogg" id="12_16brn"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_74f3x"]
bg_color = Color(0, 0, 0, 0.47451)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_gihe0"]
texture = ExtResource("3_gyniv")
[sub_resource type="GDScript" id="GDScript_owplt"]
script/source = "extends PanelContainer
var dragging: bool = false
var begwinmosposi: Vector2i # beginning windows mouse position integer
var begwinpos: Vector2i # beginning window position
func get_windows_mouse_position() -> Vector2:
var winpos := DisplayServer.window_get_position()
var mospos := get_global_mouse_position()
return Vector2(winpos.x, winpos.y) + mospos
# get windows mouse position integer
func getwinmosposi() -> Vector2i:
var mospos := get_global_mouse_position()
return DisplayServer.window_get_position() + Vector2i(floori(mospos.x), floori(mospos.y))
func _input(event: InputEvent):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if event.is_released():
dragging = false
elif dragging and event is InputEventMouseMotion:
DisplayServer.window_set_position(begwinpos + getwinmosposi() - begwinmosposi)
func _gui_input(event: InputEvent):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if event.double_click:
if get_global_rect().has_point(get_global_mouse_position()):
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
else:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
elif event.pressed:
if get_global_rect().has_point(get_global_mouse_position()):
dragging = true
begwinmosposi = getwinmosposi()
begwinpos = DisplayServer.window_get_position()
"
[sub_resource type="GDScript" id="GDScript_2514r"]
script/source = "extends Button
func _ready():
pressed.connect(test)
func test():
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_MINIMIZED)
"
[sub_resource type="GDScript" id="GDScript_dnc6v"]
script/source = "extends Button
func _ready():
pressed.connect(_on_pressed)
func _on_pressed():
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
else:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
"
[sub_resource type="GDScript" id="GDScript_hfquw"]
script/source = "extends Button
func _ready():
pressed.connect(_on_pressed)
func _on_pressed():
get_tree().quit()
"
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yu144"]
bg_color = Color(0.831373, 0.815686, 0.784314, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_eejdr"]
texture = ExtResource("8_75uw4")
texture_margin_left = 2.0
texture_margin_top = 2.0
texture_margin_right = 2.0
texture_margin_bottom = 2.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_sn8k8"]
texture = ExtResource("8_75uw4")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
[sub_resource type="GDScript" id="GDScript_2vlp5"]
script/source = "extends Button
@export var invwin: Control # inventory window
func _ready():
pressed.connect(_on_pressed)
func _on_pressed():
if invwin:
# yes i think it's better coding practice to write it this way
if invwin.visible:
invwin.visible = false
else:
invwin.visible = true
"
[node name="Desktop" type="Control" node_paths=PackedStringArray("the_game")]
texture_filter = 1
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_2cwqu")
script = ExtResource("2_1wlr7")
the_game = NodePath("VBoxContainer/MaximizedWindows/TheGame")
metadata/_edit_lock_ = true
[node name="BrightnessFilter" type="Panel" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_74f3x")
metadata/_edit_lock_ = true
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0
[node name="MaximizedWindows" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="TheGame" type="Control" parent="VBoxContainer/MaximizedWindows"]
layout_mode = 2
size_flags_vertical = 3
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/MaximizedWindows/TheGame"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer"]
layout_mode = 2
theme_override_constants/separation = 2
script = ExtResource("2_5t0g8")
[node name="PanelContainer (Header)" type="PanelContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 25)
layout_mode = 2
theme_type_variation = &"HeaderPanelContainer"
theme_override_styles/panel = SubResource("StyleBoxTexture_gihe0")
script = SubResource("GDScript_owplt")
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)"]
custom_minimum_size = Vector2(0, 26)
layout_mode = 2
theme_override_constants/separation = 0
[node name="MarginContainer (Title)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_right = 5
[node name="Label" type="Label" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Title)"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 16
text = "The Game"
[node name="MarginContainer (Minimize)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 6
[node name="Button" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Minimize)"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_vertical = 0
expand_icon = true
script = SubResource("GDScript_2514r")
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Minimize)"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_filter = 2
texture = ExtResource("2_2k613")
[node name="MarginContainer (Maximize)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 6
[node name="Button" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Maximize)"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_vertical = 0
expand_icon = true
script = SubResource("GDScript_dnc6v")
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Maximize)"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_filter = 2
texture = ExtResource("3_6tl28")
[node name="MarginContainer (Help)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 6
[node name="Button" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Help)"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_vertical = 0
expand_icon = true
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Help)"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_filter = 2
texture = ExtResource("6_byeim")
[node name="MarginContainer (Close)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 2
theme_override_constants/margin_top = 6
theme_override_constants/margin_right = 2
[node name="Button" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Close)"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_vertical = 0
expand_icon = true
script = SubResource("GDScript_hfquw")
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Header)/HBoxContainer/MarginContainer (Close)"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_filter = 2
texture = ExtResource("4_b1wjg")
[node name="PanelContainer (Menu Bar)" type="PanelContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_yu144")
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Menu Bar)"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2
theme_override_constants/separation = 0
[node name="Button" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Menu Bar)/HBoxContainer"]
layout_mode = 2
theme_type_variation = &"FlatButton"
theme_override_colors/font_color = Color(0, 0, 0, 0)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
text = "File"
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Menu Bar)/HBoxContainer/Button"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_top = 0
[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Menu Bar)/HBoxContainer/Button/MarginContainer"]
layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Menu Bar)/HBoxContainer/Button/MarginContainer/CenterContainer"]
layout_mode = 2
size_flags_vertical = 8
mouse_filter = 2
bbcode_enabled = true
text = "[u]F[/u]ile"
fit_content = true
autowrap_mode = 0
[node name="PanelContainer (Body)" type="PanelContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_type_variation = &"InvertedInnerPanelContainer"
theme_override_styles/panel = SubResource("StyleBoxTexture_eejdr")
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)"]
layout_mode = 2
theme_override_constants/separation = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 0
[node name="MarginContainer (Content)" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="SubViewportContainer" type="SubViewportContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer/MarginContainer (Content)"]
clip_children = 2
layout_mode = 2
stretch = true
[node name="SubViewport" type="SubViewport" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer/MarginContainer (Content)/SubViewportContainer"]
handle_input_locally = false
physics_object_picking = true
size = Vector2i(1124, 519)
render_target_update_mode = 4
[node name="Node3D" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer/MarginContainer (Content)/SubViewportContainer/SubViewport" instance=ExtResource("9_o80ae")]
[node name="VScrollBar" type="VScrollBar" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 1
size_flags_vertical = 3
page = 100.0
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer"]
custom_minimum_size = Vector2(0, 15)
layout_mode = 2
theme_override_constants/separation = 0
[node name="HScrollBar" type="HScrollBar" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(16, 16)
layout_mode = 2
size_flags_horizontal = 3
page = 100.0
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer/PanelContainer (Body)/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(16, 0)
layout_mode = 2
[node name="PanelContainer (Status Bar)" type="PanelContainer" parent="VBoxContainer/MaximizedWindows/TheGame/PanelContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2
size_flags_vertical = 8
theme_override_styles/panel = SubResource("StyleBoxTexture_sn8k8")
[node name="Button (Resize Handle)" type="Button" parent="VBoxContainer/MaximizedWindows/TheGame"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -17.0
offset_top = -17.0
offset_right = -5.0
offset_bottom = -5.0
grow_horizontal = 0
grow_vertical = 0
theme_type_variation = &"ResizeButton"
[node name="TaskBar" type="PanelContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 8
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TaskBar"]
layout_mode = 2
[node name="Button (Start)" type="Button" parent="VBoxContainer/TaskBar/HBoxContainer"]
layout_mode = 2
text = "Start"
[node name="Button (The Game)" type="Button" parent="VBoxContainer/TaskBar/HBoxContainer"]
layout_mode = 2
text = "The Game"
[node name="Button (Inventory)" type="Button" parent="VBoxContainer/TaskBar/HBoxContainer"]
layout_mode = 2
text = "Inventory
"
script = SubResource("GDScript_2vlp5")
[node name="DesktopWindow" parent="." node_paths=PackedStringArray("desktop", "maximized_windows", "taskbar") instance=ExtResource("11_m0w0q")]
offset_left = 132.0
offset_top = 185.0
offset_right = 293.0
offset_bottom = 320.0
desktop = NodePath("..")
maximized_windows = NodePath("../VBoxContainer/MaximizedWindows")
taskbar = NodePath("../VBoxContainer/TaskBar")
[node name="DesktopWindow2" parent="." node_paths=PackedStringArray("desktop", "maximized_windows", "taskbar") instance=ExtResource("11_m0w0q")]
offset_left = 190.0
offset_top = 197.0
offset_right = 351.0
offset_bottom = 332.0
desktop = NodePath("..")
maximized_windows = NodePath("../VBoxContainer/MaximizedWindows")
taskbar = NodePath("../VBoxContainer/TaskBar")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("12_16brn")
autoplay = true