initial commit

This commit is contained in:
2024-04-02 23:33:30 +11:00
commit 5f9db2d250
93 changed files with 2282 additions and 0 deletions

11
Quinnsoft94/clock.gd Normal file
View File

@ -0,0 +1,11 @@
class_name ClockLabel extends Label
func _process(_delta: float) -> void:
var time = Time.get_time_dict_from_system()
var suffix = "am"
if time.hour >= 12:
suffix = "pm"
if time.hour != 12:
time.hour -= 12
text = "%02d:%02d%s" % [time.hour, time.minute, suffix]

BIN
Quinnsoft94/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://csbjb0e2ks7fw"
path="res://.godot/imported/close.png-a9d0a2e01defd701cf6f50b275ecd636.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Quinnsoft94/close.png"
dest_files=["res://.godot/imported/close.png-a9d0a2e01defd701cf6f50b275ecd636.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bua3dj3bodr67"
path="res://.godot/imported/close_pressed.png-7f213f5bc717e90de8bb6d0838005c47.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Quinnsoft94/close_pressed.png"
dest_files=["res://.godot/imported/close_pressed.png-7f213f5bc717e90de8bb6d0838005c47.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

46
Quinnsoft94/desktop.gd Normal file
View File

@ -0,0 +1,46 @@
class_name Desktop extends ColorRect
@export var window_holder: Control
@export var taskbar: HBoxContainer
@export var desktop_icon_container: VBoxContainer
@export var pof_icon: Texture
@export var pof_scene: PackedScene
var window_scene = preload("res://Quinnsoft94/program_window.tscn")
func add_desktop_icon(icon: Texture, title: String, function: Callable):
var button = Button.new()
button.flat = true
button.icon = icon
button.text = title
button.size_flags_vertical = Control.SIZE_SHRINK_BEGIN
button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
button.expand_icon = true
button.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
button.custom_minimum_size = Vector2(96, 96)
button.pressed.connect(function)
desktop_icon_container.add_child(button)
func spawn_program(program_scene, icon):
var window = window_scene.instantiate() as DEWindow
window_holder.add_child(window)
var program = program_scene.instantiate() as Application
program.save_file = SaveFile.load_profile_from_disk()
add_child(program)
window.set_program(program)
var button = Button.new()
button.text = program.application_name
button.icon = icon
button.pressed.connect(window.set_visible.bind(true))
taskbar.add_child(button)
window.closed.connect(button.queue_free)
func _ready() -> void:
add_desktop_icon(pof_icon, "Plentiful Fish", spawn_program.bind(pof_scene, pof_icon))
#add_desktop_icon(uno_icon, "Uno", spawn_program.bind(uno_scene, uno_icon))
#add_desktop_icon(snakes_and_ladders_icon, "Snakes and Ladders", spawn_program.bind(snakes_and_ladders_scene, snakes_and_ladders_icon))

93
Quinnsoft94/desktop.tscn Normal file
View File

@ -0,0 +1,93 @@
[gd_scene load_steps=9 format=3 uid="uid://ddtcomingnoto"]
[ext_resource type="Script" path="res://Quinnsoft94/desktop.gd" id="1_7gagq"]
[ext_resource type="Theme" uid="uid://cfsgvdm1la7nr" path="res://Quinnsoft94/quinnsoft94.tres" id="1_ipi37"]
[ext_resource type="Script" path="res://Quinnsoft94/clock.gd" id="1_vlwj3"]
[ext_resource type="Texture2D" uid="uid://6y2jj10wkmu8" path="res://Assets/plentifulfish.png" id="3_acswl"]
[ext_resource type="PackedScene" uid="uid://wa62w2wb4pmr" path="res://Menus/PlentifulFish/PoF.tscn" id="4_o0r25"]
[ext_resource type="Texture2D" uid="uid://3ryvswnvtgpr" path="res://Assets/StartButton/start_button.png" id="5_0n3qh"]
[ext_resource type="Texture2D" uid="uid://dp5oddddyocwu" path="res://Assets/StartButton/start_button_pushed.png" id="6_7cebq"]
[ext_resource type="Texture2D" uid="uid://bhvbeyk2kv2lm" path="res://Assets/StartButton/start_button_hovered.png" id="7_uy8qo"]
[node name="PanelContainer" type="ColorRect" node_paths=PackedStringArray("window_holder", "taskbar", "desktop_icon_container")]
texture_filter = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("1_ipi37")
color = Color(0, 0.501961, 0.498039, 1)
script = ExtResource("1_7gagq")
window_holder = NodePath("Windows")
taskbar = NodePath("PanelContainer/HBoxContainer/HBoxContainer")
desktop_icon_container = NodePath("VBoxContainer")
pof_icon = ExtResource("3_acswl")
pof_scene = ExtResource("4_o0r25")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
offset_left = 40.0
offset_top = 45.0
offset_right = 136.0
offset_bottom = 239.0
mouse_filter = 2
[node name="Windows" type="Control" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -40.0
grow_horizontal = 2
grow_vertical = 0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 0
[node name="TextureButton" type="TextureButton" parent="PanelContainer/HBoxContainer/MarginContainer"]
custom_minimum_size = Vector2(96, 0)
layout_mode = 2
texture_normal = ExtResource("5_0n3qh")
texture_pressed = ExtResource("6_7cebq")
texture_hover = ExtResource("7_uy8qo")
ignore_texture_size = true
stretch_mode = 5
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/HBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 0
[node name="Clock" type="Label" parent="PanelContainer/HBoxContainer/MarginContainer2"]
layout_mode = 2
text = "10:47pm"
horizontal_alignment = 2
vertical_alignment = 1
script = ExtResource("1_vlwj3")

BIN
Quinnsoft94/minimize.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cpefkjqivf224"
path="res://.godot/imported/minimize.png-fb198f1a1795174389206d2e94adb556.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Quinnsoft94/minimize.png"
dest_files=["res://.godot/imported/minimize.png-fb198f1a1795174389206d2e94adb556.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ly4hkn1lcwmu"
path="res://.godot/imported/minimized_pressed.png-3a9a8d2206328cdfdd9d68aabece80fc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Quinnsoft94/minimized_pressed.png"
dest_files=["res://.godot/imported/minimized_pressed.png-3a9a8d2206328cdfdd9d68aabece80fc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cl8axsoyifirp"
path="res://.godot/imported/ninepatchborder.png-4c7e3fd9f7c16b4aa704f65b877f2613.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Quinnsoft94/ninepatchborder.png"
dest_files=["res://.godot/imported/ninepatchborder.png-4c7e3fd9f7c16b4aa704f65b877f2613.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@ -0,0 +1,70 @@
class_name DEWindow extends PanelContainer
signal closed()
signal minimized()
@export var title_label: Label
@export var game_holder: PanelContainer
@export var context_buttons: HBoxContainer
@export var sub_menu_parent: Control
var sub_menu_scene = preload("res://Quinnsoft94/window_sub_menu.tscn")
var application: Application
var dragging = false
var drag_offset
var sub_menus = {}
func set_program(program) -> void:
application = program
application.reparent(game_holder)
application.window = self
title_label.text = application.application_name
application.setup_window_integration()
func create_sub_menu(menu_name: String):
var menu = sub_menu_scene.instantiate()
menu.visible = false
sub_menus[menu_name] = menu
sub_menu_parent.add_child(menu)
var button = Button.new()
button.text = menu_name
context_buttons.add_child(button)
button.pressed.connect(menu.set_visible.bind(true))
context_buttons.get_parent().visible = true
func register_sub_menu_action(menu_name: String, button_text: String, function: Callable):
var button = Button.new()
button.text = button_text
button.pressed.connect(func():
function.call()
sub_menus[menu_name].visible = false
)
sub_menus[menu_name].buttons.add_child(button)
func minimize():
minimized.emit()
visible = false
func close():
closed.emit()
queue_free()
func _process(_delta: float) -> void:
if dragging:
global_position = get_global_mouse_position() + drag_offset
func _on_margin_container_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
dragging = true
move_to_front()
drag_offset = global_position - get_global_mouse_position()
if event.button_index == MOUSE_BUTTON_LEFT and !event.pressed:
dragging = false

View File

@ -0,0 +1,127 @@
[gd_scene load_steps=9 format=3 uid="uid://b1radkfqcc3hp"]
[ext_resource type="Theme" uid="uid://cfsgvdm1la7nr" path="res://Quinnsoft94/quinnsoft94.tres" id="1_l6flf"]
[ext_resource type="Script" path="res://Quinnsoft94/program_window.gd" id="2_8a3lw"]
[ext_resource type="Texture2D" uid="uid://cl8axsoyifirp" path="res://Quinnsoft94/ninepatchborder.png" id="3_6xpkt"]
[ext_resource type="Texture2D" uid="uid://cpefkjqivf224" path="res://Quinnsoft94/minimize.png" id="4_4awaw"]
[ext_resource type="Texture2D" uid="uid://ly4hkn1lcwmu" path="res://Quinnsoft94/minimized_pressed.png" id="5_cl3ca"]
[ext_resource type="Texture2D" uid="uid://csbjb0e2ks7fw" path="res://Quinnsoft94/close.png" id="6_vu4h5"]
[ext_resource type="Texture2D" uid="uid://bua3dj3bodr67" path="res://Quinnsoft94/close_pressed.png" id="7_0pdks"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_06e6f"]
bg_color = Color(0.141176, 0.568627, 0.235294, 1)
[node name="PanelContainer" type="PanelContainer" node_paths=PackedStringArray("title_label", "game_holder", "context_buttons", "sub_menu_parent")]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -69.5
offset_top = -36.0
offset_right = 69.5
offset_bottom = 36.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("1_l6flf")
script = ExtResource("2_8a3lw")
title_label = NodePath("MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/MarginContainer/WindowName")
game_holder = NodePath("MarginContainer/Binwoahs/VBoxContainer/MarginContainer/ProgramHolder")
context_buttons = NodePath("MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer2/ContextButtons")
sub_menu_parent = NodePath("MarginContainer/Binwoahs/VBoxContainer/MarginContainer")
[node name="NinePatchRect" type="NinePatchRect" parent="."]
texture_filter = 1
layout_mode = 2
texture = ExtResource("3_6xpkt")
patch_margin_left = 5
patch_margin_top = 5
patch_margin_right = 5
patch_margin_bottom = 5
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
mouse_filter = 2
[node name="Binwoahs" type="AspectRatioContainer" parent="MarginContainer"]
layout_mode = 2
mouse_filter = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/Binwoahs"]
layout_mode = 2
mouse_filter = 2
[node name="WindowDeco" type="VBoxContainer" parent="MarginContainer/Binwoahs/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco"]
layout_mode = 2
theme_type_variation = &"InnerMargin"
[node name="PanelContainer" type="PanelContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer"]
layout_mode = 2
theme_type_variation = &"WindowBarPanel"
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer"]
layout_mode = 2
theme_type_variation = &"InnerMargin"
[node name="WindowBar" type="HBoxContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0
[node name="WindowName" type="Label" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Window Title"
vertical_alignment = 1
[node name="WindowButtons" type="HBoxContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar"]
layout_mode = 2
[node name="Minimize" type="TextureButton" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/WindowButtons"]
texture_filter = 1
layout_mode = 2
texture_normal = ExtResource("4_4awaw")
texture_pressed = ExtResource("5_cl3ca")
[node name="Close" type="TextureButton" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/WindowButtons"]
texture_filter = 1
layout_mode = 2
texture_normal = ExtResource("6_vu4h5")
texture_pressed = ExtResource("7_0pdks")
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco"]
visible = false
layout_mode = 2
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0
[node name="ContextButtons" type="HBoxContainer" parent="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer2"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/Binwoahs/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
theme_type_variation = &"InnerMargin"
[node name="ProgramHolder" type="PanelContainer" parent="MarginContainer/Binwoahs/VBoxContainer/MarginContainer"]
clip_contents = true
layout_mode = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_06e6f")
[connection signal="gui_input" from="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/MarginContainer" to="." method="_on_margin_container_gui_input"]
[connection signal="button_up" from="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/WindowButtons/Minimize" to="." method="minimize"]
[connection signal="button_up" from="MarginContainer/Binwoahs/VBoxContainer/WindowDeco/MarginContainer/PanelContainer/MarginContainer/WindowBar/WindowButtons/Close" to="." method="close"]

View File

@ -0,0 +1,41 @@
[gd_resource type="Theme" load_steps=8 format=3 uid="uid://cfsgvdm1la7nr"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wv3wi"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xf03t"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0y4fm"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1gvl1"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_att5v"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_puiss"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mwvng"]
bg_color = Color(0, 0.380392, 0.611765, 1)
[resource]
Button/colors/font_color = Color(0, 0, 0, 1)
Button/styles/disabled = SubResource("StyleBoxEmpty_wv3wi")
Button/styles/focus = SubResource("StyleBoxEmpty_xf03t")
Button/styles/hover = SubResource("StyleBoxEmpty_0y4fm")
Button/styles/normal = SubResource("StyleBoxEmpty_1gvl1")
Button/styles/pressed = SubResource("StyleBoxEmpty_att5v")
HBoxContainer/constants/separation = 3
InnerMargin/base_type = &"MarginContainer"
InnerMargin/constants/margin_bottom = 2
InnerMargin/constants/margin_left = 2
InnerMargin/constants/margin_right = 2
InnerMargin/constants/margin_top = 2
Label/colors/font_color = Color(1, 1, 1, 1)
Label/colors/font_outline_color = Color(0, 0, 0, 1)
Label/constants/outline_size = 3
MarginContainer/constants/margin_bottom = 5
MarginContainer/constants/margin_left = 5
MarginContainer/constants/margin_right = 5
MarginContainer/constants/margin_top = 5
PanelContainer/styles/panel = SubResource("StyleBoxFlat_puiss")
VBoxContainer/constants/separation = 2
WindowBarPanel/base_type = &"PanelContainer"
WindowBarPanel/styles/panel = SubResource("StyleBoxFlat_mwvng")

View File

@ -0,0 +1,3 @@
class_name WindowSubMenu extends PanelContainer
@onready var buttons: VBoxContainer = $MarginContainer/VBoxContainer

View File

@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://qfh7gv5v5bjm"]
[ext_resource type="Script" path="res://Quinnsoft94/window_sub_menu.gd" id="1_x6ooa"]
[node name="PanelContainer" type="PanelContainer"]
custom_minimum_size = Vector2(150, 100)
size_flags_horizontal = 0
size_flags_vertical = 0
script = ExtResource("1_x6ooa")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2