Initial push from laptop to JepsuHub

This commit is contained in:
jepsu 2026-06-22 17:52:03 +03:00
commit 2a45cf3c72
41 changed files with 818 additions and 0 deletions

4
.editorconfig Normal file
View file

@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
/android/

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://0gyhxwe47tby"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_5jvwy"]
[resource]
script = ExtResource("1_5jvwy")
job_name = "Action figure (D&D)"
job_reward = 25.0
job_experience = 25.0
job_amount = 1
job_description = "Local D&D player needs a custom action figure for his upcoming session"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://cuff7udubpjgk"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_uaqmk"]
[resource]
script = ExtResource("1_uaqmk")
job_name = "Ad keychain with logo"
job_reward = 250.0
job_experience = 250.0
job_amount = 50
job_description = "Local company needs keychains with their logo for the local fair"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://ceck7mpy7qnae"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_y86i7"]
[resource]
script = ExtResource("1_y86i7")
job_name = "Cookiestamp with logo"
job_reward = 80.0
job_experience = 75.0
job_amount = 3
job_description = "Cafe wants to stamp their cookies with their own logo"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://5ag48elqtpg7"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_bnmyp"]
[resource]
script = ExtResource("1_bnmyp")
job_name = "Electronic control box"
job_reward = 120.0
job_experience = 110.0
job_amount = 5
job_description = "College student group needs control boxes for their prototype project"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://dg2ffm3feksrm"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_beydd"]
[resource]
script = ExtResource("1_beydd")
job_name = "Cupholder-adapter"
job_reward = 55.0
job_experience = 50.0
job_amount = 1
job_description = "Car enthusiast wants a custom cupholder-adapter for his project car"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://c3l3haowyo1yc"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_lf3ni"]
[resource]
script = ExtResource("1_lf3ni")
job_name = "Prototype drone chassis"
job_reward = 190.0
job_experience = 180.0
job_amount = 1
job_description = "Anonymous client needs a complex prototype chassis"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://0wacf77o0vq1"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_rwn1s"]
[resource]
script = ExtResource("1_rwn1s")
job_name = "Side of table headphonestand"
job_reward = 45.0
job_experience = 40.0
job_amount = 1
job_description = "Remoteworker wants to clean her desk and needs a hook for her headphones that can be attached to the table"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://dt1hgcy140fpt"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_87gqm"]
[resource]
script = ExtResource("1_87gqm")
job_name = "Modern cabinet handle"
job_reward = 60.0
job_experience = 50.0
job_amount = 4
job_description = "Designer wants you to print him modern cabinet handles for his new kitchen"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://b0akomrm6gavw"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_o5dtx"]
[resource]
script = ExtResource("1_o5dtx")
job_name = "RC-car front control arm"
job_reward = 35.0
job_experience = 35.0
job_amount = 2
job_description = "Hobbyist crashed his rc-car on a race and needs new control arms quickly"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="JobData" format=3 uid="uid://dy48odm1apexk"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_sqbnb"]
[resource]
script = ExtResource("1_sqbnb")
job_name = "Zipper pull tab"
job_reward = 15.0
job_experience = 10.0
job_amount = 1
job_description = "Neighbour asked you to print a new pull tab for his backpack"
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="PrinterData" format=3 uid="uid://bdis2u0tfvlch"]
[ext_resource type="Script" uid="uid://bed8wdnwod4wu" path="res://Resources/printer_data.gd" id="1_a3vsp"]
[resource]
script = ExtResource("1_a3vsp")
printer_manufacturer = "Bambulab"
printer_type = "A1 Mini"
printer_speed = 4.0
printer_quality = 3.5
printer_price = 350.0
metadata/_custom_type_script = "uid://bed8wdnwod4wu"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="PrinterData" format=3 uid="uid://b6x4k150ugskw"]
[ext_resource type="Script" uid="uid://bed8wdnwod4wu" path="res://Resources/printer_data.gd" id="1_nuksd"]
[resource]
script = ExtResource("1_nuksd")
printer_manufacturer = "Creality"
printer_type = "Ender-3 V3 SE"
printer_speed = 2.0
printer_quality = 2.0
printer_price = 200.0
metadata/_custom_type_script = "uid://bed8wdnwod4wu"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="PrinterData" format=3 uid="uid://b4v47rpo27kec"]
[ext_resource type="Script" uid="uid://bed8wdnwod4wu" path="res://Resources/printer_data.gd" id="1_6b1tw"]
[resource]
script = ExtResource("1_6b1tw")
printer_manufacturer = "Prusa Research"
printer_type = "MK4S"
printer_speed = 4.5
printer_quality = 5.0
printer_price = 850.0
metadata/_custom_type_script = "uid://bed8wdnwod4wu"

8
Resources/job_data.gd Normal file
View file

@ -0,0 +1,8 @@
class_name JobData
extends Resource
@export var job_name: String
@export var job_reward: float
@export var job_experience: float
@export var job_amount: int
@export var job_description: String

View file

@ -0,0 +1 @@
uid://bp1c3unpg2ndn

View file

@ -0,0 +1,8 @@
class_name PrinterData
extends Resource
@export var printer_manufacturer: String
@export var printer_type: String
@export_range(1, 5) var printer_speed: float
@export_range(1, 5) var printer_quality: float
@export var printer_price: float

View file

@ -0,0 +1 @@
uid://bed8wdnwod4wu

1
icon.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>

After

Width:  |  Height:  |  Size: 995 B

43
icon.svg.import Normal file
View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dmmvrmeoobeo5"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

19
job_card.gd Normal file
View file

@ -0,0 +1,19 @@
extends PanelContainer
signal job_accepted
var job_data: JobData
@onready var job_name: Label = $MarginContainer/VBoxContainer/HBoxContainer2/PartName
@onready var job_amount: Label = $MarginContainer/VBoxContainer/HBoxContainer3/PartAmount
@onready var job_reward: Label = $MarginContainer/VBoxContainer/HBoxContainer/RewardLabel
@onready var job_experience: Label = $MarginContainer/VBoxContainer/HBoxContainer3/PartExperience
func initialize_job(data: JobData) -> void:
job_data = data
job_name.text = job_data.job_name
job_amount.text = "Amount: " + str(job_data.job_amount)
job_reward.text = "Reward: " + str(job_data.job_reward) + ""
job_experience.text = "Experience: " + str(job_data.job_experience)
func _on_accept_job_pressed() -> void:
job_accepted.emit(self)

1
job_card.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://wjam0w8dmel3

64
job_card.tscn Normal file
View file

@ -0,0 +1,64 @@
[gd_scene format=3 uid="uid://dvfcie8hqcb0"]
[ext_resource type="Script" uid="uid://wjam0w8dmel3" path="res://job_card.gd" id="1_vsles"]
[node name="JobCard" type="PanelContainer" unique_id=1714388686]
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_vsles")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2020543953]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=136204542]
layout_mode = 2
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1483771792]
layout_mode = 2
[node name="PartName" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=558034559]
layout_mode = 2
theme_override_font_sizes/font_size = 22
text = "Benchy"
[node name="PartMaterial" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=1875039539]
layout_mode = 2
text = ": PLA"
[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=923172092]
layout_mode = 2
[node name="PartExperience" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3" unique_id=1599086122]
layout_mode = 2
text = "Experience: 40"
[node name="PartAmount" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3" unique_id=1418182269]
layout_mode = 2
text = "Amount: 1"
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1428599849]
layout_mode = 2
theme_override_constants/separation = 4
[node name="RewardLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1031960459]
layout_mode = 2
size_flags_horizontal = 3
text = "Reward: 5 €"
[node name="TimeLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=142510012]
layout_mode = 2
size_flags_horizontal = 3
text = "Time: 3 min"
horizontal_alignment = 1
[node name="AcceptJob" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1475207118]
layout_mode = 2
size_flags_horizontal = 3
text = "Accept Job"
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/AcceptJob" to="." method="_on_accept_job_pressed"]

8
printer.gd Normal file
View file

@ -0,0 +1,8 @@
extends PanelContainer
var printer_data: PrinterData
@onready var model: Label = $MarginContainer/VBoxContainer/HBoxContainer/Model
func initialize_printer(data: PrinterData) -> void:
printer_data = data
model.text = printer_data.printer_manufacturer + printer_data.printer_type

1
printer.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://dj7pngpg53qdb

67
printer.tscn Normal file
View file

@ -0,0 +1,67 @@
[gd_scene format=3 uid="uid://33ctlyrpibs3"]
[ext_resource type="Script" uid="uid://dj7pngpg53qdb" path="res://printer.gd" id="1_jhpce"]
[node name="Printer" type="PanelContainer" unique_id=1372437203]
custom_minimum_size = Vector2(0, 150)
offset_right = 271.0
offset_bottom = 182.0
size_flags_horizontal = 3
script = ExtResource("1_jhpce")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1159449756]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=2137617795]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1033555892]
layout_mode = 2
[node name="Model" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=397114791]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "Printer #1"
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=2117616913]
layout_mode = 2
text = "Status: Free"
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1502076264]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/VBoxContainer" unique_id=181392172]
layout_mode = 2
text = "Material: PLA"
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/VBoxContainer" unique_id=1516591173]
layout_mode = 2
text = "Time left: 15.0"
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/VBoxContainer/VBoxContainer" unique_id=768246659]
layout_mode = 2
value = 67.0
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=248340191]
layout_mode = 2
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=500388805]
layout_mode = 2
size_flags_horizontal = 3
text = "Start job"
[node name="Button2" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=765929805]
layout_mode = 2
size_flags_horizontal = 3
text = "Upgrade"
[node name="Button3" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2" unique_id=929234066]
layout_mode = 2
size_flags_horizontal = 3
text = "Sell printer"
[node name="Timer" type="Timer" parent="." unique_id=425740035]

22
printer_card.gd Normal file
View file

@ -0,0 +1,22 @@
extends PanelContainer
signal buy_printer
var printer_data: PrinterData
@onready var printer_name: Label = $MarginContainer/VBoxContainer/PrinterInfo/PrinterName
@onready var printer_model: Label = $MarginContainer/VBoxContainer/PrinterInfo/PrinterModel
@onready var printer_speed: Label = $MarginContainer/VBoxContainer/PrinterStats/SpeedLabel
@onready var printer_quality: Label = $MarginContainer/VBoxContainer/PrinterStats/QualityLabel
@onready var printer_price: Label = $MarginContainer/VBoxContainer/HBoxContainer/Price
@onready var buy_button: Button = $MarginContainer/VBoxContainer/HBoxContainer/BuyButton
func initialize_printer(data: PrinterData) -> void:
printer_data = data
printer_name.text = printer_data.printer_manufacturer
printer_model.text = printer_data.printer_type
printer_speed.text = "Speed: " + str(printer_data.printer_speed) + "/5"
printer_quality.text = "Quality: " + str(printer_data.printer_quality) + "/5"
printer_price.text = "Price: " + str(printer_data.printer_price) + ""
func _on_buy_button_pressed() -> void:
buy_printer.emit(self)

1
printer_card.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://ttfk4n2fkifj

17
printers.gd Normal file
View file

@ -0,0 +1,17 @@
extends PanelContainer
signal printer_purchase_requested(printer_data: PrinterData)
@export var printers_array: Array[PrinterData]
const PRINTER_SCENE = preload("uid://bdpqvwvwmaian")
func _ready() -> void:
for printer in printers_array:
var new_printer = PRINTER_SCENE.instantiate()
$PrinterList.add_child(new_printer)
new_printer.initialize_printer(printer)
new_printer.buy_printer.connect(_buy_printer_pressed)
func _buy_printer_pressed(bought_printer):
print("Printer model: " + bought_printer.printer_data.printer_type)
printer_purchase_requested.emit(bought_printer.printer_data)

1
printers.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://d3g5e8wjfqy5i

59
printers_card.tscn Normal file
View file

@ -0,0 +1,59 @@
[gd_scene format=3 uid="uid://bdpqvwvwmaian"]
[ext_resource type="Script" uid="uid://ttfk4n2fkifj" path="res://printer_card.gd" id="1_5nuqd"]
[node name="PrinterCard" type="PanelContainer" unique_id=1714388686]
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_5nuqd")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2020543953]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=136204542]
layout_mode = 2
[node name="PrinterInfo" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1483771792]
layout_mode = 2
[node name="PrinterName" type="Label" parent="MarginContainer/VBoxContainer/PrinterInfo" unique_id=558034559]
layout_mode = 2
theme_override_font_sizes/font_size = 22
text = "Prousa"
[node name="PrinterModel" type="Label" parent="MarginContainer/VBoxContainer/PrinterInfo" unique_id=1875039539]
layout_mode = 2
text = ": MK2"
[node name="PrinterStats" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=676238633]
layout_mode = 2
[node name="SpeedLabel" type="Label" parent="MarginContainer/VBoxContainer/PrinterStats" unique_id=1031960459]
layout_mode = 2
size_flags_horizontal = 3
text = "Speed: 1 / 5"
[node name="QualityLabel" type="Label" parent="MarginContainer/VBoxContainer/PrinterStats" unique_id=142510012]
layout_mode = 2
size_flags_horizontal = 3
text = "Quality: 1 / 5"
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1428599849]
layout_mode = 2
theme_override_constants/separation = 4
[node name="Price" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=586182920]
layout_mode = 2
size_flags_horizontal = 3
text = "Price: 500 €"
[node name="BuyButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1475207118]
layout_mode = 2
size_flags_horizontal = 3
text = "Buy"
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/BuyButton" to="." method="_on_buy_button_pressed"]

25
project.godot Normal file
View file

@ -0,0 +1,25 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="3D-printing simulator (Text based)"
run/main_scene="uid://d24rvu5c0gd1w"
config/features=PackedStringArray("4.6", "Mobile")
config/icon="res://icon.svg"
[physics]
3d/physics_engine="Jolt Physics"
[rendering]
rendering_device/driver.windows="d3d12"
renderer/rendering_method="mobile"

13
shop_tab_switcher.gd Normal file
View file

@ -0,0 +1,13 @@
extends MarginContainer
func _ready() -> void:
%Printers.visible = true
%Filaments.visible = false
func _on_printers_button_pressed() -> void:
%Printers.visible = true
%Filaments.visible = false
func _on_filaments_button_pressed() -> void:
%Printers.visible = false
%Filaments.visible = true

1
shop_tab_switcher.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://cg2kskiky8iur

21
tab_switcher.gd Normal file
View file

@ -0,0 +1,21 @@
extends MarginContainer
func _ready() -> void:
%JobsTab.visible = true
%ShopTab.visible = false
%MenuTab.visible = false
func _on_jobs_tab_button_pressed() -> void:
%JobsTab.visible = true
%ShopTab.visible = false
%MenuTab.visible = false
func _on_shop_tab_button_pressed() -> void:
%JobsTab.visible = false
%ShopTab.visible = true
%MenuTab.visible = false
func _on_menu_tab_button_pressed() -> void:
%JobsTab.visible = false
%ShopTab.visible = false
%MenuTab.visible = true

1
tab_switcher.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://q8cf21vq4ka6

64
ui.gd Normal file
View file

@ -0,0 +1,64 @@
extends Control
@export var jobs_array: Array[JobData]
@export var job_limit: int = 5
@export var money: float = 500
var jobs_tab_button: Button
const job_scene = preload("uid://dvfcie8hqcb0")
const PRINTER = preload("uid://33ctlyrpibs3")
var experience: float = 0
var level: int = 0
func _ready() -> void:
%Money.text = "Money: " + str(money) + ""
%Experience.value = experience
%Level.text = "Level: " + str(level)
jobs_tab_button = $VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton
func generate_job():
var job_count = %JobContainer.get_children()
#print("Current jobs: " + str(job_count.size()))
if not job_count.size() >= job_limit:
var random_job: JobData = jobs_array.pick_random()
var new_job = job_scene.instantiate()
%JobContainer.add_child(new_job)
new_job.initialize_job(random_job)
job_count = %JobContainer.get_children()
jobs_tab_button.text = "Jobs (" + str(job_count.size()) + "/" + str(job_limit) + ")"
new_job.job_accepted.connect(_on_job_accepted_pressed)
func _on_job_accepted_pressed(accepted_job):
print("Job accepted")
#give_experience(accepted_job.job_data.job_experience)
#give_money(accepted_job.job_data.job_reward)
accepted_job.queue_free()
var job_count = %JobContainer.get_child_count() - 1
jobs_tab_button.text = "Jobs (" + str(job_count) + "/" + str(job_limit) + ")"
func _on_job_spawner_timeout() -> void:
generate_job()
func give_experience(amount: float) -> void:
experience += amount
if experience >= 100:
while experience >= 100:
level += 1
experience -= 100
%Level.text = "Level: " + str(level)
%Experience.value = experience
func give_money(amount: float) -> void:
money += amount
%Money.text = "Money: " + str(money) + ""
func _on_printers_printer_purchase_requested(printer_data: PrinterData) -> void:
if printer_data.printer_price <= money:
money -= printer_data.printer_price
%Money.text = "Money: " + str(money) + ""
var new_printer = PRINTER.instantiate()
%PrinterContainer.add_child(new_printer)
new_printer.initialize_printer(printer_data)

1
ui.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://d0sgvbphgssmi

205
ui.tscn Normal file
View file

@ -0,0 +1,205 @@
[gd_scene format=3 uid="uid://d24rvu5c0gd1w"]
[ext_resource type="Script" uid="uid://d0sgvbphgssmi" path="res://ui.gd" id="1_27fn8"]
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="2_etlur"]
[ext_resource type="Resource" uid="uid://0gyhxwe47tby" path="res://Resources/Jobs/job_action_figure.tres" id="3_7rqds"]
[ext_resource type="Script" uid="uid://q8cf21vq4ka6" path="res://tab_switcher.gd" id="3_ibotj"]
[ext_resource type="Resource" uid="uid://cuff7udubpjgk" path="res://Resources/Jobs/job_ad_keychain.tres" id="4_nvb2n"]
[ext_resource type="Resource" uid="uid://ceck7mpy7qnae" path="res://Resources/Jobs/job_cafe_cookie_stamp.tres" id="5_os5c7"]
[ext_resource type="Resource" uid="uid://5ag48elqtpg7" path="res://Resources/Jobs/job_college_electronic_box.tres" id="6_b2p7n"]
[ext_resource type="Resource" uid="uid://dg2ffm3feksrm" path="res://Resources/Jobs/job_cup_holder_seat.tres" id="7_vkygq"]
[ext_resource type="Resource" uid="uid://c3l3haowyo1yc" path="res://Resources/Jobs/job_drone_chassis.tres" id="8_sosvr"]
[ext_resource type="Resource" uid="uid://0wacf77o0vq1" path="res://Resources/Jobs/job_headphone_stand_tableside.tres" id="9_ndy3v"]
[ext_resource type="Resource" uid="uid://dt1hgcy140fpt" path="res://Resources/Jobs/job_modern_cabinet_handle.tres" id="10_x2s2p"]
[ext_resource type="Resource" uid="uid://b0akomrm6gavw" path="res://Resources/Jobs/job_rc_car_control_arm.tres" id="11_v8jk5"]
[ext_resource type="Resource" uid="uid://dy48odm1apexk" path="res://Resources/Jobs/job_zipper_pull_tab.tres" id="12_cka8k"]
[ext_resource type="Script" uid="uid://cg2kskiky8iur" path="res://shop_tab_switcher.gd" id="14_b2p7n"]
[ext_resource type="Script" uid="uid://d3g5e8wjfqy5i" path="res://printers.gd" id="14_etlur"]
[ext_resource type="Script" uid="uid://bed8wdnwod4wu" path="res://Resources/printer_data.gd" id="15_os5c7"]
[ext_resource type="Resource" uid="uid://bdis2u0tfvlch" path="res://Resources/Printers/printer_bambulab_A1_mini.tres" id="16_b2p7n"]
[ext_resource type="Resource" uid="uid://b6x4k150ugskw" path="res://Resources/Printers/printer_creality_ender_3.tres" id="17_vkygq"]
[ext_resource type="Resource" uid="uid://b4v47rpo27kec" path="res://Resources/Printers/printer_prusa_mk4s.tres" id="18_sosvr"]
[node name="UI" type="Control" unique_id=256887379]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_27fn8")
jobs_array = Array[ExtResource("2_etlur")]([ExtResource("3_7rqds"), ExtResource("4_nvb2n"), ExtResource("5_os5c7"), ExtResource("6_b2p7n"), ExtResource("7_vkygq"), ExtResource("8_sosvr"), ExtResource("9_ndy3v"), ExtResource("10_x2s2p"), ExtResource("11_v8jk5"), ExtResource("12_cka8k")])
job_limit = 4
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1634044894]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="TopBar" type="PanelContainer" parent="VBoxContainer" unique_id=96075233]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/TopBar" unique_id=1068942919]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/TopBar/VBoxContainer" unique_id=1261087154]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer" unique_id=487881719]
layout_mode = 2
alignment = 1
[node name="Money" type="Label" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=2146628247]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Money: 0 €"
[node name="Time" type="Label" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=1503956629]
visible = false
layout_mode = 2
size_flags_horizontal = 3
text = "Time: 12:00"
horizontal_alignment = 1
[node name="Level" type="Label" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=1016279160]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Level: 1"
horizontal_alignment = 2
[node name="Experience" type="ProgressBar" parent="VBoxContainer/TopBar/VBoxContainer" unique_id=38033766]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 5)
layout_mode = 2
value = 67.0
show_percentage = false
[node name="MainArea" type="HBoxContainer" parent="VBoxContainer" unique_id=352001241]
layout_mode = 2
[node name="LeftColumn" type="VBoxContainer" parent="VBoxContainer/MainArea" unique_id=497978034]
layout_mode = 2
size_flags_horizontal = 3
[node name="Header" type="MarginContainer" parent="VBoxContainer/MainArea/LeftColumn" unique_id=674103883]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="Label" type="Label" parent="VBoxContainer/MainArea/LeftColumn/Header" unique_id=1155403735]
layout_mode = 2
text = "Printers"
[node name="PrinterContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/LeftColumn" unique_id=374703275]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="RightColumn" type="VBoxContainer" parent="VBoxContainer/MainArea" unique_id=653054059]
layout_mode = 2
size_flags_horizontal = 3
[node name="TabSwitcher" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=1366955734]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
script = ExtResource("3_ibotj")
[node name="TabButtons" type="HBoxContainer" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher" unique_id=454550378]
layout_mode = 2
[node name="JobsTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=332022453]
layout_mode = 2
size_flags_horizontal = 3
text = "Jobs"
[node name="ShopTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=748682284]
layout_mode = 2
size_flags_horizontal = 3
text = "Shop"
[node name="MenuTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=1414728414]
layout_mode = 2
size_flags_horizontal = 3
text = "Menu"
[node name="JobsTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=859027615]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="JobContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/JobsTab" unique_id=1821891785]
unique_name_in_owner = true
layout_mode = 2
[node name="ShopTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=23859514]
unique_name_in_owner = true
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab" unique_id=1098619767]
layout_mode = 2
[node name="ShopTabSwitcher" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer" unique_id=40136169]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
script = ExtResource("14_b2p7n")
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher" unique_id=1669205646]
layout_mode = 2
[node name="PrintersButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=96323903]
layout_mode = 2
size_flags_horizontal = 3
text = "Printers"
[node name="FilamentsButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=659653173]
layout_mode = 2
size_flags_horizontal = 3
text = "Filaments"
[node name="Printers" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer" unique_id=1896524960]
unique_name_in_owner = true
layout_mode = 2
script = ExtResource("14_etlur")
printers_array = Array[ExtResource("15_os5c7")]([ExtResource("16_b2p7n"), ExtResource("17_vkygq"), ExtResource("18_sosvr")])
[node name="PrinterList" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/Printers" unique_id=474412195]
layout_mode = 2
[node name="Filaments" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer" unique_id=1891341317]
unique_name_in_owner = true
layout_mode = 2
[node name="MenuTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=526907583]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="JobSpawner" type="Timer" parent="." unique_id=1696213535]
wait_time = 3.0
autostart = true
[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_jobs_tab_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/ShopTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_shop_tab_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"]
[connection signal="printer_purchase_requested" from="VBoxContainer/MainArea/RightColumn/ShopTab/VBoxContainer/Printers" to="." method="_on_printers_printer_purchase_requested"]
[connection signal="timeout" from="JobSpawner" to="." method="_on_job_spawner_timeout"]