Compare commits
No commits in common. "main" and "v0.1" have entirely different histories.
78 changed files with 1946 additions and 1679 deletions
|
|
@ -1,13 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="FilamentData" format=3 uid="uid://gmby6rjd07wi"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="1_uvxfr"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_uvxfr")
|
||||
material = "ABS - Small"
|
||||
reward_multiplier = 1.0
|
||||
xp_multiplier = 1.0
|
||||
amount = 200.0
|
||||
price = 4.18
|
||||
description = "ABS filament for industrial applications"
|
||||
metadata/_custom_type_script = "uid://cim8peoxip2si"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="FilamentData" format=3 uid="uid://gm0cqq0ggri"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="1_ws0fq"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ws0fq")
|
||||
material = "ASA-CF - Small"
|
||||
reward_multiplier = 1.0
|
||||
xp_multiplier = 1.0
|
||||
amount = 200.0
|
||||
price = 7.74
|
||||
description = "Carbon fibre-reinforced ASA to withstand extreme performance"
|
||||
level_req = 3
|
||||
metadata/_custom_type_script = "uid://cim8peoxip2si"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="FilamentData" format=3 uid="uid://cwtaryim1yjnu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="1_02q3j"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_02q3j")
|
||||
material = "ASA - Small"
|
||||
reward_multiplier = 1.0
|
||||
xp_multiplier = 1.0
|
||||
amount = 200.0
|
||||
price = 5.3
|
||||
description = "Weather and UV resistant ASA filament"
|
||||
metadata/_custom_type_script = "uid://cim8peoxip2si"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="FilamentData" format=3 uid="uid://vuby4u37cu42"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="1_w3dqi"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_w3dqi")
|
||||
material = "PETG - Small"
|
||||
reward_multiplier = 1.0
|
||||
xp_multiplier = 1.0
|
||||
amount = 200.0
|
||||
price = 5.23
|
||||
description = "PETG filament for robust & precise prints"
|
||||
level_req = 2
|
||||
metadata/_custom_type_script = "uid://cim8peoxip2si"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="FilamentData" format=3 uid="uid://dvu3hbx3tn0nx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="1_7duty"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_7duty")
|
||||
material = "PLA"
|
||||
reward_multiplier = 1.0
|
||||
xp_multiplier = 1.0
|
||||
amount = 200.0
|
||||
price = 4.18
|
||||
description = "Filament with reduced plastic content"
|
||||
metadata/_custom_type_script = "uid://cim8peoxip2si"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
[gd_resource type="Resource" script_class="JobList" format=3 uid="uid://buvi8m3atoavu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bp1c3unpg2ndn" path="res://Resources/job_data.gd" id="1_nybwa"]
|
||||
[ext_resource type="Resource" uid="uid://0gyhxwe47tby" path="res://Resources/Jobs/job_action_figure.tres" id="2_7dwwk"]
|
||||
[ext_resource type="Script" uid="uid://dmfdc1mnd4dy5" path="res://Resources/job_list.gd" id="2_8lx8r"]
|
||||
[ext_resource type="Resource" uid="uid://cuff7udubpjgk" path="res://Resources/Jobs/job_ad_keychain.tres" id="3_s4yce"]
|
||||
[ext_resource type="Resource" uid="uid://ceck7mpy7qnae" path="res://Resources/Jobs/job_cafe_cookie_stamp.tres" id="4_eriey"]
|
||||
[ext_resource type="Resource" uid="uid://5ag48elqtpg7" path="res://Resources/Jobs/job_college_electronic_box.tres" id="5_gkqel"]
|
||||
[ext_resource type="Resource" uid="uid://dg2ffm3feksrm" path="res://Resources/Jobs/job_cup_holder_seat.tres" id="6_d2ue3"]
|
||||
[ext_resource type="Resource" uid="uid://c3l3haowyo1yc" path="res://Resources/Jobs/job_drone_chassis.tres" id="7_nayax"]
|
||||
[ext_resource type="Resource" uid="uid://0wacf77o0vq1" path="res://Resources/Jobs/job_headphone_stand_tableside.tres" id="8_1p1kw"]
|
||||
[ext_resource type="Resource" uid="uid://dt1hgcy140fpt" path="res://Resources/Jobs/job_modern_cabinet_handle.tres" id="9_cfo7u"]
|
||||
[ext_resource type="Resource" uid="uid://b0akomrm6gavw" path="res://Resources/Jobs/job_rc_car_control_arm.tres" id="10_awcc0"]
|
||||
[ext_resource type="Resource" uid="uid://dy48odm1apexk" path="res://Resources/Jobs/job_zipper_pull_tab.tres" id="11_mr4tb"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_8lx8r")
|
||||
jobs = Array[ExtResource("1_nybwa")]([ExtResource("2_7dwwk"), ExtResource("3_s4yce"), ExtResource("4_eriey"), ExtResource("5_gkqel"), ExtResource("6_d2ue3"), ExtResource("7_nayax"), ExtResource("8_1p1kw"), ExtResource("9_cfo7u"), ExtResource("10_awcc0"), ExtResource("11_mr4tb")])
|
||||
metadata/_custom_type_script = "uid://dmfdc1mnd4dy5"
|
||||
|
|
@ -6,8 +6,7 @@
|
|||
script = ExtResource("1_5jvwy")
|
||||
job_name = "Action figure (D&D)"
|
||||
job_reward = 25.0
|
||||
job_experience = 30.0
|
||||
job_experience = 25.0
|
||||
job_amount = 1
|
||||
job_difficulty = 3
|
||||
job_description = "Local D&D player needs a custom action figure for his upcoming session"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
[resource]
|
||||
script = ExtResource("1_uaqmk")
|
||||
job_name = "Ad keychain with logo"
|
||||
job_reward = 5.0
|
||||
job_experience = 8.0
|
||||
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"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ job_name = "Cookiestamp with logo"
|
|||
job_reward = 80.0
|
||||
job_experience = 75.0
|
||||
job_amount = 3
|
||||
job_difficulty = 2
|
||||
job_description = "Cafe wants to stamp their cookies with their own logo"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ job_name = "Electronic control box"
|
|||
job_reward = 120.0
|
||||
job_experience = 110.0
|
||||
job_amount = 5
|
||||
job_difficulty = 3
|
||||
job_description = "College student group needs control boxes for their prototype project"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ job_name = "Cupholder-adapter"
|
|||
job_reward = 55.0
|
||||
job_experience = 50.0
|
||||
job_amount = 1
|
||||
job_difficulty = 2
|
||||
job_description = "Car enthusiast wants a custom cupholder-adapter for his project car"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ job_name = "Prototype drone chassis"
|
|||
job_reward = 190.0
|
||||
job_experience = 180.0
|
||||
job_amount = 1
|
||||
job_difficulty = 5
|
||||
job_description = "Anonymous client needs a complex prototype chassis"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ job_name = "RC-car front control arm"
|
|||
job_reward = 35.0
|
||||
job_experience = 35.0
|
||||
job_amount = 2
|
||||
job_difficulty = 4
|
||||
job_description = "Hobbyist crashed his rc-car on a race and needs new control arms quickly"
|
||||
metadata/_custom_type_script = "uid://bp1c3unpg2ndn"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ printer_manufacturer = "Bambulab"
|
|||
printer_type = "A1 Mini"
|
||||
printer_speed = 4.0
|
||||
printer_quality = 3.5
|
||||
printer_level_req = 5
|
||||
printer_price = 350.0
|
||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
script = ExtResource("1_nuksd")
|
||||
printer_manufacturer = "Creality"
|
||||
printer_type = "Ender-3 V3 SE"
|
||||
printer_speed = 1.0
|
||||
printer_quality = 1.0
|
||||
printer_speed = 2.0
|
||||
printer_quality = 2.0
|
||||
printer_price = 200.0
|
||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ printer_manufacturer = "Prusa Research"
|
|||
printer_type = "MK4S"
|
||||
printer_speed = 4.5
|
||||
printer_quality = 5.0
|
||||
printer_level_req = 10
|
||||
printer_price = 850.0
|
||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
class_name FilamentData
|
||||
extends Resource
|
||||
|
||||
@export var material: String
|
||||
@export var reward_multiplier: float
|
||||
@export var xp_multiplier: float
|
||||
@export var amount: float
|
||||
@export var price: float
|
||||
@export var description: String = ""
|
||||
@export var level_req: int = 1
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cim8peoxip2si
|
||||
|
|
@ -14,28 +14,14 @@ extends Resource
|
|||
set(value):
|
||||
job_amount = value
|
||||
_generate_job_time()
|
||||
|
||||
# - Difficulty from 1 to 5: Easy, Medium, Hard, Pain, Torture
|
||||
@export var job_difficulty: int = 1:
|
||||
set(value):
|
||||
clamp(value, 1, 5)
|
||||
job_difficulty = value
|
||||
_generate_job_time()
|
||||
|
||||
@export var job_description: String
|
||||
|
||||
@export var job_material: String = "PLA":
|
||||
set(value):
|
||||
job_material = value
|
||||
_generate_job_time()
|
||||
|
||||
var job_time: float
|
||||
var job_material: String = "PLA"
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
_generate_job_time()
|
||||
|
||||
# Generate printing time
|
||||
func _generate_job_time() -> void:
|
||||
var print_time: float = sqrt(job_experience + job_reward) * job_amount
|
||||
var round_time: float = round(print_time * 100) / 100
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
class_name JobList
|
||||
extends Resource
|
||||
|
||||
@export var jobs: Array[JobData] = []
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://dmfdc1mnd4dy5
|
||||
|
|
@ -5,5 +5,4 @@ extends Resource
|
|||
@export var printer_type: String
|
||||
@export_range(1, 5) var printer_speed: float
|
||||
@export_range(1, 5) var printer_quality: float
|
||||
@export var printer_level_req: int = 1
|
||||
@export var printer_price: float
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
extends Node
|
||||
|
||||
signal amount_changed(new_amount)
|
||||
|
||||
var filament_data: FilamentData
|
||||
var amount: float:
|
||||
set(value):
|
||||
amount = value
|
||||
amount_changed.emit(amount)
|
||||
|
||||
|
||||
func initialize_filament(data: FilamentData) -> void:
|
||||
filament_data = data
|
||||
amount = filament_data.amount
|
||||
print("Filament added: ", filament_data.material)
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://saed3mn0c2cw
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://ckjg1eynole7p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://saed3mn0c2cw" path="res://Scenes/Filament/filament.gd" id="1_b0mke"]
|
||||
|
||||
[node name="Filament" type="Node" unique_id=274664749]
|
||||
script = ExtResource("1_b0mke")
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
extends Node
|
||||
|
||||
# - Signals
|
||||
signal job_generated(job: Node)
|
||||
signal job_interact
|
||||
signal printer_bought(printer: Node)
|
||||
@warning_ignore("unused_signal")
|
||||
signal refresh_printer_dropdown
|
||||
signal notification_requested(message: String, color: String)
|
||||
|
||||
# - Variables - Code managed
|
||||
var job_spawn_timer: Timer
|
||||
var inventory: Node
|
||||
var jobs_array: Array[JobData]
|
||||
var current_job_count: int = 0
|
||||
var filaments_array: Array[Node]
|
||||
|
||||
# - Text colors
|
||||
var hex_white: String = '#ffffff'
|
||||
var hex_green: String = '#4ade80'
|
||||
var hex_blue: String = '#60a5fa'
|
||||
var hex_red: String = '#f87171'
|
||||
|
||||
# - Scenes
|
||||
const JOB_CARD = preload("uid://dvfcie8hqcb0")
|
||||
const PRINTER = preload("uid://33ctlyrpibs3")
|
||||
const ALL_JOBS = preload("uid://buvi8m3atoavu")
|
||||
const FILAMENT = preload("uid://ckjg1eynole7p")
|
||||
|
||||
|
||||
# - Constants - Settings
|
||||
# Jobs
|
||||
const JOB_SPAWN_WAIT: float = 2.0
|
||||
var max_jobs: int = PlayerData.max_order_amount
|
||||
|
||||
func _ready() -> void:
|
||||
jobs_array = ALL_JOBS.jobs
|
||||
|
||||
# Create timer for job spawning
|
||||
job_spawn_timer = Timer.new()
|
||||
inventory = Node.new()
|
||||
add_child(job_spawn_timer)
|
||||
add_child(inventory)
|
||||
job_spawn_timer.wait_time = JOB_SPAWN_WAIT
|
||||
job_spawn_timer.one_shot = false
|
||||
job_spawn_timer.timeout.connect(_on_job_spawn_timer_timeout)
|
||||
job_spawn_timer.start()
|
||||
|
||||
func display_msg(message: String, color: String) -> void:
|
||||
notification_requested.emit(message,color)
|
||||
|
||||
#region Shop buy interactions
|
||||
func _on_shop_printer_purchase_req(printer_data: PrinterData) -> void:
|
||||
if PlayerData.try_purchase(printer_data.printer_price):
|
||||
var new_printer = PRINTER.instantiate()
|
||||
printer_bought.emit(new_printer)
|
||||
new_printer.initialize_printer(printer_data)
|
||||
PlayerData.owned_printers += 1
|
||||
|
||||
func _on_shop_filament_purchase_req(filament_data: FilamentData) -> void:
|
||||
if PlayerData.try_purchase(filament_data.price):
|
||||
var new_filament = FILAMENT.instantiate()
|
||||
inventory.add_child(new_filament)
|
||||
new_filament.initialize_filament(filament_data)
|
||||
#filaments_array.append(new_filament)
|
||||
#endregion
|
||||
|
||||
#region Job generation
|
||||
func _on_job_spawn_timer_timeout() -> void:
|
||||
#generate_job()
|
||||
draw_job()
|
||||
|
||||
func generate_job() -> void:
|
||||
if not current_job_count >= max_jobs:
|
||||
var random_job: JobData = jobs_array.pick_random()
|
||||
current_job_count += 1
|
||||
var new_job = JOB_CARD.instantiate()
|
||||
job_generated.emit(new_job)
|
||||
new_job.initialize_job(random_job)
|
||||
new_job.job_accepted.connect(_on_job_accepted_pressed)
|
||||
job_interact.emit()
|
||||
|
||||
func draw_job() -> void:
|
||||
if not current_job_count >= max_jobs:
|
||||
var job: JobData = generate_random_job()
|
||||
current_job_count += 1
|
||||
var new_job = JOB_CARD.instantiate()
|
||||
job_generated.emit(new_job)
|
||||
new_job.initialize_job(job)
|
||||
new_job.job_accepted.connect(_on_job_accepted_pressed)
|
||||
job_interact.emit()
|
||||
|
||||
func generate_random_job() -> JobData:
|
||||
var new_job = JobData.new()
|
||||
var random_job: JobData = jobs_array.pick_random()
|
||||
var amount = randf_range(1, PlayerData.max_order_amount)
|
||||
|
||||
new_job.job_name = random_job.job_name
|
||||
new_job.job_reward = random_job.job_reward * amount
|
||||
new_job.job_experience = random_job.job_experience * amount
|
||||
new_job.job_difficulty = random_job.job_difficulty
|
||||
new_job.job_amount = roundf(amount)
|
||||
|
||||
return new_job
|
||||
|
||||
func _on_job_accepted_pressed(accepted_job) -> void:
|
||||
PlayerData.jobs.append(accepted_job.job_data)
|
||||
GameData.current_job_count -= 1
|
||||
accepted_job.queue_free()
|
||||
job_interact.emit()
|
||||
#endregion
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://d3abg1dpwrkmq
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
extends Node
|
||||
|
||||
var xp: float = 0:
|
||||
set(value):
|
||||
xp = value
|
||||
xp_changed.emit(xp)
|
||||
|
||||
var money: float = 9999:
|
||||
set(value):
|
||||
money = value
|
||||
money_changed.emit(money)
|
||||
|
||||
var level: int = 1:
|
||||
set(value):
|
||||
level = value
|
||||
level_changed.emit(level)
|
||||
|
||||
var max_order_amount: int = 3:
|
||||
set(value):
|
||||
max_order_amount = value
|
||||
max_order_amount_changed.emit(max_order_amount)
|
||||
|
||||
var owned_printers: int = 0:
|
||||
set(value):
|
||||
owned_printers = value
|
||||
owned_printers_changed.emit(value)
|
||||
|
||||
var sell_multiplier: float = 0.5:
|
||||
set(value):
|
||||
sell_multiplier = value
|
||||
|
||||
var failure_chance: float = 0.6:
|
||||
set(value):
|
||||
failure_chance = value
|
||||
|
||||
var jobs: Array[JobData]
|
||||
|
||||
# Signal - player stats
|
||||
signal xp_changed(new_xp)
|
||||
signal money_changed(new_money)
|
||||
signal level_changed(new_level)
|
||||
signal max_order_amount_changed(new_max_order_amount)
|
||||
signal owned_printers_changed(new_amount)
|
||||
|
||||
# Signal - functions
|
||||
signal give_experience(xp_amount)
|
||||
signal give_money(money_amount)
|
||||
|
||||
func _ready() -> void:
|
||||
give_experience.connect(_on_give_experience)
|
||||
give_money.connect(_on_give_money)
|
||||
|
||||
func _on_give_experience(amount: float) -> void:
|
||||
print('Gave: %.0f xp' % amount)
|
||||
xp += amount
|
||||
|
||||
while xp >= xp_required_for_level(level):
|
||||
xp -= xp_required_for_level(level)
|
||||
level += 1
|
||||
|
||||
func _on_give_money(amount: float) -> void:
|
||||
money += amount
|
||||
|
||||
func xp_required_for_level(player_level: int) -> float:
|
||||
if player_level == 1:
|
||||
return 100.0
|
||||
|
||||
var base_xp = 100 * (player_level - 1)
|
||||
var exponent_xp = pow(player_level - 1, 1.8) * 25
|
||||
|
||||
return float(base_xp + exponent_xp)
|
||||
|
||||
func try_purchase(amount) -> bool:
|
||||
if amount <= money:
|
||||
money -= amount
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://xpks7daol1db"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cesw3a37hqn08" path="res://Scenes/Map/map.gd" id="1_iio4a"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6icyfxslhlmc" path="res://Scenes/Map/map_tile.tscn" id="2_lcs11"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_7g6h4"]
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(0.057391837, 0.057391845, 0.057391837, 1)
|
||||
fog_enabled = true
|
||||
fog_light_color = Color(0.7149284, 0.74206614, 0.7842839, 1)
|
||||
fog_sky_affect = 0.0
|
||||
|
||||
[sub_resource type="Curve" id="Curve_v0tmn"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_m2fa0"]
|
||||
curve = SubResource("Curve_v0tmn")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_6kfdn"]
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(10, 0.2, 10)
|
||||
angle_min = 1.0728835e-05
|
||||
angle_max = 360.00003
|
||||
direction = Vector3(1, 0, 1)
|
||||
initial_velocity_min = 0.049999997
|
||||
initial_velocity_max = 0.19999999
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 2.0
|
||||
scale_max = 4.0
|
||||
alpha_curve = SubResource("CurveTexture_m2fa0")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_yju8x"]
|
||||
offsets = PackedFloat32Array(0.2, 0.8)
|
||||
metadata/_snap_enabled = true
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_11lgl"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_lcs11"]
|
||||
noise = SubResource("FastNoiseLite_11lgl")
|
||||
color_ramp = SubResource("Gradient_yju8x")
|
||||
|
||||
[sub_resource type="ORMMaterial3D" id="ORMMaterial3D_11lgl"]
|
||||
transparency = 1
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(1, 1, 1, 0.11764706)
|
||||
albedo_texture = SubResource("NoiseTexture2D_lcs11")
|
||||
proximity_fade_enabled = true
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_lcs11"]
|
||||
material = SubResource("ORMMaterial3D_11lgl")
|
||||
radius = 2.0
|
||||
height = 4.0
|
||||
|
||||
[node name="Map" type="Node3D" unique_id=1765565476]
|
||||
script = ExtResource("1_iio4a")
|
||||
tile_scene = ExtResource("2_lcs11")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=40432726]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.7071068, 0.7071068, 0, -0.7071068, 0.7071068, 0, 6, 5)
|
||||
|
||||
[node name="MapTile" parent="." unique_id=441860049 instance_placeholder="res://Scenes/Map/map_tile.tscn"]
|
||||
|
||||
[node name="Control" type="CanvasLayer" parent="." unique_id=1301244712]
|
||||
|
||||
[node name="Button" type="Button" parent="Control" unique_id=1524228928]
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -73.5
|
||||
offset_top = 46.0
|
||||
offset_right = 72.5
|
||||
offset_bottom = 79.0
|
||||
grow_horizontal = 2
|
||||
text = "Generate new tile"
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1838982295]
|
||||
environment = SubResource("Environment_7g6h4")
|
||||
|
||||
[node name="EnvFog" type="GPUParticles3D" parent="." unique_id=1381169011]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
amount = 50
|
||||
lifetime = 10.0
|
||||
process_material = SubResource("ParticleProcessMaterial_6kfdn")
|
||||
draw_pass_1 = SubResource("SphereMesh_lcs11")
|
||||
|
||||
[connection signal="pressed" from="Control/Button" to="." method="_on_button_pressed"]
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
extends Node3D
|
||||
|
||||
@export var tile_scene: PackedScene
|
||||
@export var tile_size: float = 2.0
|
||||
@export var tile_separation: float = 0.2
|
||||
|
||||
var generated_tiles: Dictionary = {}
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_tile(Vector2i(0, 0))
|
||||
|
||||
func spawn_tile(grid_pos: Vector2i) -> void:
|
||||
if generated_tiles.has(grid_pos):
|
||||
return
|
||||
|
||||
var tile = tile_scene.instantiate()
|
||||
add_child(tile)
|
||||
|
||||
var x_spacing = tile_size * 0.75 + tile_separation
|
||||
var z_spacing = tile_size * sqrt(3) / 2 + tile_separation
|
||||
|
||||
var pos_x = grid_pos.x * x_spacing
|
||||
var pos_z = grid_pos.y * z_spacing + (abs(grid_pos.x) % 2) * (z_spacing / 2.0)
|
||||
|
||||
var target_position = Vector3(pos_x, 0, pos_z)
|
||||
|
||||
tile.transform.origin = Vector3(pos_x, -3.0, pos_z)
|
||||
|
||||
generated_tiles[grid_pos] = tile
|
||||
if tile.has_method("initialize"):
|
||||
tile.initialize(grid_pos.x, grid_pos.y)
|
||||
|
||||
var tween = create_tween()
|
||||
var tile_light = tile.get_node_or_null("OmniLight3D")
|
||||
if tile_light:
|
||||
tile_light.light_energy = 0.0
|
||||
|
||||
tween.tween_property(tile, "position", target_position, 0.8)\
|
||||
.set_trans(Tween.TRANS_CUBIC)\
|
||||
.set_ease(Tween.EASE_OUT)
|
||||
|
||||
if tile_light:
|
||||
tween.parallel().tween_property(tile_light, "light_energy", 1.5, 0.8)\
|
||||
.set_trans(Tween.TRANS_CUBIC)\
|
||||
.set_ease(Tween.EASE_OUT)
|
||||
|
||||
func get_hex_neighbors(grid_pos: Vector2i) -> Array[Vector2i]:
|
||||
var neighbors: Array[Vector2i] = []
|
||||
|
||||
neighbors.append(grid_pos + Vector2i(0, -1)) # Neighbor Up
|
||||
neighbors.append(grid_pos + Vector2i(0, 1)) # Neighbor Down
|
||||
neighbors.append(grid_pos + Vector2i(-1, 0)) # Neighbor Left
|
||||
neighbors.append(grid_pos + Vector2i(1, 0)) # Neighbor Right
|
||||
|
||||
if abs(grid_pos.x) % 2 == 1:
|
||||
neighbors.append(grid_pos + Vector2i(-1, 1)) # Neighbor Left-Down
|
||||
neighbors.append(grid_pos + Vector2i(1, 1)) # Neighbor Right-Down
|
||||
else:
|
||||
neighbors.append(grid_pos + Vector2i(-1, -1)) # Neighbor Left-Up
|
||||
neighbors.append(grid_pos + Vector2i(1, -1)) # Neighbor Right-Up
|
||||
return neighbors
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
var open_neighbors = []
|
||||
|
||||
for current_pos in generated_tiles.keys():
|
||||
var neighbors = get_hex_neighbors(current_pos)
|
||||
for n_pos in neighbors:
|
||||
if not generated_tiles.has(n_pos) and not open_neighbors.has(n_pos):
|
||||
open_neighbors.append(n_pos)
|
||||
|
||||
if open_neighbors.size() > 0:
|
||||
var random_target_pos = open_neighbors[randi() % open_neighbors.size()]
|
||||
spawn_tile(random_target_pos)
|
||||
print("Generated new tile at: ", random_target_pos)
|
||||
else:
|
||||
print("World is full")
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cesw3a37hqn08
|
||||
|
|
@ -1 +0,0 @@
|
|||
extends Node3D
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://db7luam5x7vhs
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://c6icyfxslhlmc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://db7luam5x7vhs" path="res://Scenes/Map/map_tile.gd" id="1_0t1dj"]
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_7g6h4"]
|
||||
top_radius = 1.0
|
||||
bottom_radius = 1.0
|
||||
height = 0.2
|
||||
radial_segments = 6
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_7g6h4"]
|
||||
height = 0.22
|
||||
radius = 0.859375
|
||||
|
||||
[node name="MapTile" type="Node3D" unique_id=441860049]
|
||||
transform = Transform3D(-4.3711385e-08, 0, -0.99999994, 0, 1, 0, 0.99999994, 0, -4.3711385e-08, 0, 0, 0)
|
||||
script = ExtResource("1_0t1dj")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=786384927]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)
|
||||
mesh = SubResource("CylinderMesh_7g6h4")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="MeshInstance3D" unique_id=519127025]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/Area3D" unique_id=318914845]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0057469606, 0)
|
||||
shape = SubResource("CylinderShape3D_7g6h4")
|
||||
debug_color = Color(0, 0.6509804, 0.08627451, 0.52156866)
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1228933535]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2232149, 0)
|
||||
light_energy = 1.5
|
||||
|
|
@ -1,247 +0,0 @@
|
|||
extends PanelContainer
|
||||
|
||||
@onready var printer_name_label: Label = $MarginContainer/MainArea/TopInfo/PrinterLabel
|
||||
@onready var printer_model_label: Label = $MarginContainer/MainArea/Model/PrinterModelLabel
|
||||
@onready var progress_bar: ProgressBar = $MarginContainer/MainArea/PrintInfo/ProgressBar
|
||||
@onready var select_job: OptionButton = $MarginContainer/MainArea/SelectJob
|
||||
@onready var select_filament: OptionButton = $MarginContainer/MainArea/SelectFilament
|
||||
@onready var status_label: RichTextLabel = $MarginContainer/MainArea/TopInfo/StatusLabel
|
||||
@onready var time_left_label: RichTextLabel = $MarginContainer/MainArea/PrintInfo/InfoRow2/TimeLeftLabel
|
||||
@onready var start_button: Button = $MarginContainer/MainArea/Buttons/StartButton
|
||||
@onready var reward_label: RichTextLabel = $MarginContainer/MainArea/PrintInfo/InfoRow2/RewardLabel
|
||||
@onready var quality_label: RichTextLabel = $MarginContainer/MainArea/PrintInfo/InfoRow1/QualityLabel
|
||||
@onready var loaded_filament_label: RichTextLabel = $MarginContainer/MainArea/PrintInfo/InfoRow1/LoadedFilament
|
||||
|
||||
|
||||
var printer_data: PrinterData
|
||||
|
||||
# - Job and Filament selection variables
|
||||
var selected_job: JobData
|
||||
var selected_job_index: int
|
||||
var selected_filament: Node = null
|
||||
var selected_filament_index: int
|
||||
|
||||
# - Printer states
|
||||
var is_printing: bool = false
|
||||
var print_failed: bool = false
|
||||
|
||||
# Variables - Failure calculations
|
||||
var time_left: float
|
||||
var failure_points: Array
|
||||
var failure_point_amount: float = 5
|
||||
var print_quality: float = 1.0
|
||||
|
||||
func _ready() -> void:
|
||||
GameData.refresh_printer_dropdown.connect(_on_refresh_printer_dropdown)
|
||||
|
||||
func initialize_printer(data: PrinterData) -> void:
|
||||
printer_data = data
|
||||
printer_name_label.text = printer_data.printer_manufacturer
|
||||
printer_model_label.text = printer_data.printer_type
|
||||
quality_label.visible = false
|
||||
reward_label.visible = false
|
||||
time_left_label.visible = false
|
||||
loaded_filament_label.visible = true
|
||||
time_left = 0
|
||||
status_label.text = 'Status: [color=%s]%s[/color]' % [GameData.hex_white, "Free"]
|
||||
progress_bar.visible = false
|
||||
progress_bar.value = 0
|
||||
|
||||
GameData.display_msg('%s printer bought!' % printer_data.printer_manufacturer, GameData.hex_green)
|
||||
_on_select_job_pressed()
|
||||
_on_select_filament_pressed()
|
||||
|
||||
func _process(delta) -> void:
|
||||
if is_printing:
|
||||
select_job.hide()
|
||||
select_filament.hide()
|
||||
progress_bar.show()
|
||||
time_left_label.show()
|
||||
quality_label.show()
|
||||
reward_label.show()
|
||||
set_status()
|
||||
|
||||
var text_color = GameData.hex_green
|
||||
if print_quality < 1.0:
|
||||
text_color = GameData.hex_red
|
||||
|
||||
quality_label.text = 'Quality: [color=%s]%.0f%%[/color]' % [text_color, (print_quality * 100)]
|
||||
reward_label.text = 'Reward: [color=%s]%.2f €[/color]' % [text_color, (selected_job.job_reward * print_quality)]
|
||||
|
||||
var total_time = selected_job.job_time / printer_data.printer_speed
|
||||
var progress = (total_time - time_left) / total_time
|
||||
|
||||
selected_filament.amount -= 0.5 * delta
|
||||
time_left -= delta
|
||||
progress_bar.value = progress
|
||||
time_left_label.text = 'Time left: [color=%s]%s[/color]' % [GameData.hex_blue, calculate_time_left(time_left)]
|
||||
|
||||
if time_left <= 0:
|
||||
var end_reward = selected_job.job_reward * print_quality
|
||||
var end_xp = selected_job.job_experience * print_quality
|
||||
PlayerData.give_money.emit(end_reward)
|
||||
PlayerData.give_experience.emit(end_xp)
|
||||
GameData.display_msg('Print completed! Got %.2f €' % end_reward, GameData.hex_green)
|
||||
reset_status()
|
||||
|
||||
# Old print failure condition - 1st Fail, 2nd + 3rd Quality decrease
|
||||
#if failure_points.has(roundf(progress_bar.value * 100)):
|
||||
#if failure_points[0] == roundf(progress_bar.value * 100):
|
||||
#if check_failure(roundf(progress_bar.value * 100)):
|
||||
#print_failed = true
|
||||
#reset_status()
|
||||
#elif check_failure(roundf(progress_bar.value * 100)):
|
||||
#print_quality -= 0.1
|
||||
|
||||
# New print failure condition - Only quality decrease
|
||||
if failure_points.has(roundf(progress_bar.value * 100)):
|
||||
if check_failure(roundf(progress_bar.value * 100)):
|
||||
print_quality -= 0.1
|
||||
|
||||
func reset_status() -> void:
|
||||
is_printing = false
|
||||
set_status()
|
||||
print_failed = false
|
||||
print_quality = 1.0
|
||||
failure_points = []
|
||||
time_left_label.hide()
|
||||
quality_label.hide()
|
||||
reward_label.hide()
|
||||
progress_bar.hide()
|
||||
progress_bar.value = 0
|
||||
time_left = 0
|
||||
select_filament.show()
|
||||
select_job.disabled = false
|
||||
select_job.show()
|
||||
start_button.disabled = false
|
||||
_on_select_job_pressed()
|
||||
|
||||
func set_status() -> void:
|
||||
var color_hex: String = GameData.hex_white
|
||||
var status: String
|
||||
if print_failed:
|
||||
status = 'Failed'
|
||||
color_hex = GameData.hex_red
|
||||
GameData.display_msg('Print failed!',color_hex)
|
||||
elif is_printing:
|
||||
status = 'Printing'
|
||||
color_hex = GameData.hex_blue
|
||||
else:
|
||||
status = 'Free'
|
||||
color_hex = GameData.hex_green
|
||||
|
||||
status_label.text = 'Status: [color=%s]%s[/color]' % [color_hex, status]
|
||||
|
||||
func calculate_fail_thresholds() -> Array:
|
||||
var failure_checkpoints: Array = []
|
||||
var failure_range = roundf(100.0 / failure_point_amount)
|
||||
|
||||
for point in failure_point_amount:
|
||||
var range_min = failure_checkpoints.size() * (failure_range + 1)
|
||||
var range_max = failure_checkpoints.size() * (failure_range + 1) + failure_range
|
||||
failure_checkpoints.append(roundf(randf_range(\
|
||||
range_min, range_max)))
|
||||
|
||||
print('Failure points: ', failure_checkpoints)
|
||||
return failure_checkpoints
|
||||
|
||||
func check_failure(value: float) -> bool:
|
||||
if randf() >= PlayerData.failure_chance:
|
||||
failure_points[failure_points.bsearch(value, true)] = 0
|
||||
return false
|
||||
else:
|
||||
failure_points[failure_points.bsearch(value, true)] = 0
|
||||
return true
|
||||
|
||||
func calculate_time_left(time) -> String:
|
||||
var minutes: int = 0
|
||||
if time >= 60:
|
||||
while time >= 60:
|
||||
minutes += 1
|
||||
time -= 60
|
||||
return '%d m %.2f s' % [minutes, time]
|
||||
else:
|
||||
return '%.2f s' % time
|
||||
|
||||
func _on_refresh_printer_dropdown() -> void:
|
||||
if is_printing:
|
||||
return
|
||||
_on_select_job_pressed()
|
||||
|
||||
func _on_sell_button_pressed() -> void:
|
||||
PlayerData.give_money.emit(printer_data.printer_price * PlayerData.sell_multiplier)
|
||||
PlayerData.owned_printers -= 1
|
||||
queue_free()
|
||||
|
||||
func _on_select_filament_pressed() -> void:
|
||||
select_filament.clear()
|
||||
var current_filaments = GameData.inventory.get_children()
|
||||
|
||||
if current_filaments.is_empty():
|
||||
select_filament.add_item("Out of filament")
|
||||
loaded_filament_label.text = 'Loaded filament: None'
|
||||
selected_filament = null
|
||||
else:
|
||||
for filament in current_filaments:
|
||||
var data = filament.filament_data
|
||||
var amount = filament.amount
|
||||
|
||||
var item_text = '%s | %.2f g' % [data.material, amount]
|
||||
select_filament.add_item(item_text)
|
||||
|
||||
var current_index = select_filament.item_count - 1
|
||||
select_filament.set_item_metadata(current_index, filament)
|
||||
selected_filament = select_filament.get_item_metadata(0)
|
||||
selected_job_index = 0
|
||||
selected_filament.amount_changed.connect(_on_filament_amount_changed)
|
||||
_on_filament_amount_changed(selected_filament.amount)
|
||||
|
||||
func _on_select_filament_item_selected(index: int) -> void:
|
||||
selected_filament = select_filament.get_item_metadata(index)
|
||||
selected_filament_index = index
|
||||
selected_filament.amount_changed.connect(_on_filament_amount_changed)
|
||||
_on_filament_amount_changed(selected_filament.amount)
|
||||
|
||||
func _on_select_job_pressed() -> void:
|
||||
select_job.clear()
|
||||
if PlayerData.jobs.is_empty():
|
||||
select_job.add_item("No jobs accepted")
|
||||
start_button.disabled = true
|
||||
else:
|
||||
start_button.disabled = false
|
||||
for job in PlayerData.jobs:
|
||||
var item_text = '%s (XP: %.2f | %.2f € | %s)' %\
|
||||
[job.job_name, job.job_experience, job.job_reward, calculate_time_left(job.job_time / printer_data.printer_speed)]
|
||||
select_job.add_item(item_text)
|
||||
|
||||
var current_index = select_job.item_count - 1
|
||||
select_job.set_item_metadata(current_index, job)
|
||||
selected_job = select_job.get_item_metadata(0)
|
||||
selected_job_index = 0
|
||||
|
||||
func _on_select_job_item_selected(index: int) -> void:
|
||||
selected_job = select_job.get_item_metadata(index)
|
||||
selected_job_index = index
|
||||
|
||||
func _on_filament_amount_changed(new_amount: float) -> void:
|
||||
loaded_filament_label.text = 'Loaded filament: [color=%s]%s | %.2f g[/color]' % [GameData.hex_blue, selected_filament.filament_data.material, new_amount]
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
if select_job.get_item_text(0) == "No jobs accepted":
|
||||
return
|
||||
if select_filament.get_item_text(0) == "Out of filament":
|
||||
return
|
||||
|
||||
time_left = selected_job.job_time / printer_data.printer_speed
|
||||
progress_bar.value = 0
|
||||
start_button.disabled = true
|
||||
is_printing = true
|
||||
|
||||
# Remove job from job selection dropdown
|
||||
if PlayerData.jobs.size() == 1:
|
||||
PlayerData.jobs.clear()
|
||||
else:
|
||||
PlayerData.jobs.remove_at(selected_job_index)
|
||||
|
||||
failure_points = calculate_fail_thresholds()
|
||||
GameData.refresh_printer_dropdown.emit()
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
extends PanelContainer
|
||||
|
||||
signal buy_filament
|
||||
|
||||
var filament_data: FilamentData
|
||||
@onready var filament_material: Label = %Material
|
||||
@onready var description: Label = %Description
|
||||
@onready var reward_multiplier: Label = %RewardMultiplier
|
||||
@onready var xp_multiplier: Label = %ExperienceMultiplier
|
||||
@onready var amount: Label = %Amount
|
||||
@onready var price_tag: Label = %PriceTag
|
||||
@onready var buy_button: Button = $Margin/Info/Price/BuyButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
PlayerData.money_changed.connect(_on_toggle_button)
|
||||
|
||||
func initialize_filament(data: FilamentData) -> void:
|
||||
filament_data = data
|
||||
filament_material.text = filament_data.material
|
||||
description.text = filament_data.description
|
||||
reward_multiplier.text = 'Reward multiplier: x%.1f' % filament_data.reward_multiplier
|
||||
xp_multiplier.text = 'Experience multiplier: x%.1f' % filament_data.xp_multiplier
|
||||
amount.text = 'Amount: %.0f g' % filament_data.amount
|
||||
price_tag.text = 'Price: %.2f €' % filament_data.price
|
||||
|
||||
func _on_buy_button_pressed() -> void:
|
||||
buy_filament.emit(self)
|
||||
|
||||
func _on_toggle_button(money) -> void:
|
||||
if PlayerData.money >= filament_data.price:
|
||||
buy_button.disabled = false
|
||||
else:
|
||||
buy_button.disabled = true
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://o733qdkp8lxl
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://csq76iufxrb4y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o733qdkp8lxl" path="res://Scenes/Shop/Filaments/shop_filament_card.gd" id="1_gtjvs"]
|
||||
|
||||
[node name="FilamentsCard" type="PanelContainer" unique_id=368185874]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_gtjvs")
|
||||
|
||||
[node name="Margin" type="MarginContainer" parent="." unique_id=1163688479]
|
||||
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="Info" type="VBoxContainer" parent="Margin" unique_id=1453497579]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="VBoxContainer" parent="Margin/Info" unique_id=1904589169]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Material" type="Label" parent="Margin/Info/Title" unique_id=24143253]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LOL-CF"
|
||||
|
||||
[node name="Description" type="Label" parent="Margin/Info/Title" unique_id=870869096]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Filament description goes here"
|
||||
|
||||
[node name="Multipliers" type="HBoxContainer" parent="Margin/Info" unique_id=2026319482]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RewardMultiplier" type="Label" parent="Margin/Info/Multipliers" unique_id=867010603]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Reward multiplier: x1.0"
|
||||
|
||||
[node name="ExperienceMultiplier" type="Label" parent="Margin/Info/Multipliers" unique_id=1033367043]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Experience multiplier: x1.0"
|
||||
|
||||
[node name="ProductInfo" type="HBoxContainer" parent="Margin/Info" unique_id=1243250288]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Amount" type="Label" parent="Margin/Info/ProductInfo" unique_id=1356405418]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Amount: 123 g"
|
||||
|
||||
[node name="Price" type="HBoxContainer" parent="Margin/Info" unique_id=926000726]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PriceTag" type="Label" parent="Margin/Info/Price" unique_id=881459224]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Price: 1.23 €"
|
||||
|
||||
[node name="BuyButton" type="Button" parent="Margin/Info/Price" unique_id=780730344]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Buy"
|
||||
|
||||
[connection signal="pressed" from="Margin/Info/Price/BuyButton" to="." method="_on_buy_button_pressed"]
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
extends PanelContainer
|
||||
|
||||
signal filament_purchase_requested(filament_data: FilamentData)
|
||||
|
||||
@export var filaments_array: Array[FilamentData]
|
||||
const SHOP_FILAMENTS_CARD = preload("uid://csq76iufxrb4y")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
generate_filaments()
|
||||
filament_purchase_requested.connect(GameData._on_shop_filament_purchase_req)
|
||||
PlayerData.level_changed.connect(_on_level_changed)
|
||||
|
||||
func generate_filaments() -> void:
|
||||
for child in %FilamentList.get_children():
|
||||
child.queue_free()
|
||||
for filament in filaments_array:
|
||||
if PlayerData.level >= filament.level_req:
|
||||
var new_filament = SHOP_FILAMENTS_CARD.instantiate()
|
||||
%FilamentList.add_child(new_filament)
|
||||
new_filament.initialize_filament(filament)
|
||||
new_filament.buy_filament.connect(_on_buy_filament_pressed)
|
||||
|
||||
func _on_buy_filament_pressed(bought_filament) -> void:
|
||||
filament_purchase_requested.emit(bought_filament.filament_data)
|
||||
|
||||
func _on_level_changed(_level) -> void:
|
||||
generate_filaments()
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://bcowlm04qsgqc
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
extends PanelContainer
|
||||
|
||||
signal printer_purchase_requested(printer_data: PrinterData)
|
||||
|
||||
@export var printers_array: Array[PrinterData]
|
||||
const PRINTER_SCENE = preload("uid://bdpqvwvwmaian")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
generate_printers()
|
||||
printer_purchase_requested.connect(GameData._on_shop_printer_purchase_req)
|
||||
PlayerData.level_changed.connect(_on_level_changed)
|
||||
|
||||
func generate_printers() -> void:
|
||||
for child in %PrinterList.get_children():
|
||||
child.queue_free()
|
||||
for printer in printers_array:
|
||||
if PlayerData.level >= printer.printer_level_req:
|
||||
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) -> void:
|
||||
printer_purchase_requested.emit(bought_printer.printer_data)
|
||||
|
||||
func _on_level_changed(_level) -> void:
|
||||
generate_printers()
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
extends MarginContainer
|
||||
|
||||
@onready var printers_button: Button = $HBoxContainer/PrintersButton
|
||||
@onready var filaments_button: Button = $HBoxContainer/FilamentsButton
|
||||
|
||||
func _ready() -> void:
|
||||
%Printers.visible = true
|
||||
%Filaments.visible = false
|
||||
disable_buttons("printers")
|
||||
|
||||
func _on_printers_button_pressed() -> void:
|
||||
%Printers.visible = true
|
||||
%Filaments.visible = false
|
||||
disable_buttons("printers")
|
||||
|
||||
func _on_filaments_button_pressed() -> void:
|
||||
%Printers.visible = false
|
||||
%Filaments.visible = true
|
||||
disable_buttons("filaments")
|
||||
|
||||
func disable_buttons(tab: String) -> void:
|
||||
printers_button.disabled = true
|
||||
filaments_button.disabled = true
|
||||
|
||||
match tab:
|
||||
"printers":
|
||||
filaments_button.disabled = false
|
||||
"filaments":
|
||||
printers_button.disabled = false
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
extends Control
|
||||
|
||||
@export var debug: bool = false
|
||||
|
||||
@onready var debug_xp: Button = $GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP
|
||||
@onready var debug_money: Button = $GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney
|
||||
@onready var debug_button: Button = $GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton
|
||||
@onready var jobs_tab_button: Button = $GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton
|
||||
|
||||
const PRINTER = preload("uid://33ctlyrpibs3")
|
||||
|
||||
func _ready() -> void:
|
||||
check_debug()
|
||||
|
||||
_on_xp_changed(PlayerData.xp)
|
||||
_on_level_changed(PlayerData.level)
|
||||
_on_money_changed(PlayerData.money)
|
||||
|
||||
PlayerData.xp_changed.connect(_on_xp_changed)
|
||||
PlayerData.level_changed.connect(_on_level_changed)
|
||||
PlayerData.money_changed.connect(_on_money_changed)
|
||||
GameData.job_generated.connect(_on_job_generated)
|
||||
GameData.job_interact.connect(_on_job_interact)
|
||||
GameData.printer_bought.connect(_on_printer_bought)
|
||||
|
||||
# --- Experience, Level and Money update ---
|
||||
func _on_xp_changed(xp) -> void:
|
||||
var target_xp = PlayerData.xp_required_for_level(PlayerData.level)
|
||||
var required_xp_to_value = (float(PlayerData.xp) / target_xp) * 100
|
||||
%Experience.value = required_xp_to_value
|
||||
|
||||
func _on_level_changed(level) -> void:
|
||||
%Level.text = 'Level: %d' % level
|
||||
|
||||
func _on_money_changed(money) -> void:
|
||||
%Money.text = 'Money: %.2f €' % money
|
||||
|
||||
func _on_job_interact() -> void:
|
||||
jobs_tab_button.text = 'Jobs (%d / %d)' % [GameData.current_job_count, GameData.max_jobs]
|
||||
|
||||
func _on_job_generated(job: Node) -> void:
|
||||
%JobContainer.add_child(job)
|
||||
|
||||
func _on_printer_bought(new_printer: Node) -> void:
|
||||
%PrinterContainer.add_child(new_printer)
|
||||
|
||||
#region Debug
|
||||
func check_debug() -> void:
|
||||
debug_xp.visible = false
|
||||
debug_money.visible = false
|
||||
if debug:
|
||||
debug_xp.visible = true
|
||||
debug_money.visible = true
|
||||
|
||||
func _on_debug_money_pressed() -> void:
|
||||
PlayerData.give_money.emit(100)
|
||||
|
||||
func _on_debug_xp_pressed() -> void:
|
||||
var xp = randf() * 100
|
||||
PlayerData.give_experience.emit(xp)
|
||||
|
||||
func _on_debug_button_pressed() -> void:
|
||||
toggle_debug()
|
||||
|
||||
func toggle_debug() -> void:
|
||||
if debug == true:
|
||||
debug = false
|
||||
else:
|
||||
debug = true
|
||||
check_debug()
|
||||
#endregion
|
||||
|
|
@ -1,359 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://d24rvu5c0gd1w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d0sgvbphgssmi" path="res://Scenes/UI/ui.gd" id="1_vqjbf"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4tdg221rvm53" path="res://Scenes/UI/ui_notification.tscn" id="2_s3gqk"]
|
||||
[ext_resource type="Script" uid="uid://bcowlm04qsgqc" path="res://Scenes/Shop/Printers/shop_filaments.gd" id="9_mbl0m"]
|
||||
[ext_resource type="Script" uid="uid://cim8peoxip2si" path="res://Resources/filament_data.gd" id="10_vy225"]
|
||||
[ext_resource type="Resource" uid="uid://dvu3hbx3tn0nx" path="res://Resources/Filaments/filament_pla.tres" id="11_fy0us"]
|
||||
[ext_resource type="Resource" uid="uid://vuby4u37cu42" path="res://Resources/Filaments/filament_petg.tres" id="12_fy0us"]
|
||||
[ext_resource type="Script" uid="uid://q8cf21vq4ka6" path="res://Scenes/tab_switcher.gd" id="13_vqjbf"]
|
||||
[ext_resource type="Script" uid="uid://cg2kskiky8iur" path="res://Scenes/Shop/shop_tab_switcher.gd" id="14_vqjbf"]
|
||||
[ext_resource type="Script" uid="uid://d3g5e8wjfqy5i" path="res://Scenes/Shop/Printers/shop_printers.gd" id="15_vqjbf"]
|
||||
[ext_resource type="Script" uid="uid://bed8wdnwod4wu" path="res://Resources/printer_data.gd" id="16_rdojl"]
|
||||
[ext_resource type="Resource" uid="uid://bdis2u0tfvlch" path="res://Resources/Printers/printer_bambulab_A1_mini.tres" id="17_llrls"]
|
||||
[ext_resource type="Resource" uid="uid://b6x4k150ugskw" path="res://Resources/Printers/printer_creality_ender_3.tres" id="18_8rt22"]
|
||||
[ext_resource type="Resource" uid="uid://b4v47rpo27kec" path="res://Resources/Printers/printer_prusa_mk4s.tres" id="19_1ohgd"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_7g6h4"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8fchy"]
|
||||
bg_color = Color(0.3529412, 0.47843137, 0.7372549, 0.47058824)
|
||||
corner_radius_top_left = 6
|
||||
corner_radius_top_right = 6
|
||||
corner_radius_bottom_right = 6
|
||||
corner_radius_bottom_left = 6
|
||||
corner_detail = 6
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cqvjp"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vqjbf"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qru7b"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mmlst"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
|
||||
[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_vqjbf")
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D" parent="." unique_id=61421642]
|
||||
position = Vector2(568, 312)
|
||||
amount = 60
|
||||
lifetime = 8.0
|
||||
preprocess = 8.0
|
||||
speed_scale = 0.3
|
||||
emission_shape = 3
|
||||
emission_rect_extents = Vector2(1000, 600)
|
||||
direction = Vector2(0, -1)
|
||||
gravity = Vector2(0, 0)
|
||||
initial_velocity_min = 20.0
|
||||
initial_velocity_max = 50.0
|
||||
scale_amount_min = 2.0
|
||||
scale_amount_max = 5.0
|
||||
color = Color(0.45585775, 0.45585775, 0.4558577, 1)
|
||||
color_ramp = SubResource("Gradient_7g6h4")
|
||||
|
||||
[node name="GameArea" 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="GameArea" unique_id=96075233]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="GameArea/TopBar" unique_id=1068942919]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameArea/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="GameArea/TopBar/VBoxContainer/MarginContainer" unique_id=487881719]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Money" type="Label" parent="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=2146628247]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Money: 0 €"
|
||||
|
||||
[node name="DebugMoney" type="Button" parent="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=601739475]
|
||||
layout_mode = 2
|
||||
text = "Give 100€"
|
||||
|
||||
[node name="DebugXP" type="Button" parent="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=535993224]
|
||||
layout_mode = 2
|
||||
text = "Give xp"
|
||||
|
||||
[node name="Time" type="Label" parent="GameArea/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="GameArea/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="DebugButton" type="Button" parent="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=255003152]
|
||||
layout_mode = 2
|
||||
text = "Debug"
|
||||
|
||||
[node name="Experience" type="ProgressBar" parent="GameArea/TopBar/VBoxContainer" unique_id=38033766]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 5)
|
||||
layout_mode = 2
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_8fchy")
|
||||
value = 65.27
|
||||
show_percentage = false
|
||||
|
||||
[node name="MainAreaMargin" type="MarginContainer" parent="GameArea" unique_id=1858818142]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_top = 5
|
||||
|
||||
[node name="MainArea" type="HBoxContainer" parent="GameArea/MainAreaMargin" unique_id=352001241]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="LeftColumn" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea" unique_id=497978034]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MainMargin" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn" unique_id=1390444828]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Header" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin" unique_id=674103883]
|
||||
visible = false
|
||||
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="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin/Header" unique_id=1155403735]
|
||||
layout_mode = 2
|
||||
text = "Printers"
|
||||
|
||||
[node name="PrinterScroll" type="ScrollContainer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin" unique_id=1351903470]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin/PrinterScroll" unique_id=134445001]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
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="PrinterContainer" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin/PrinterScroll/MarginContainer" unique_id=374703275]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="Printer" parent="GameArea/MainAreaMargin/MainArea/LeftColumn/MainMargin/PrinterScroll/MarginContainer/PrinterContainer" unique_id=1372437203 instance_placeholder="res://Scenes/Printer/printer.tscn"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RightColumn" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea" unique_id=653054059]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TabSwitcher" type="MarginContainer" parent="GameArea/MainAreaMargin/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("13_vqjbf")
|
||||
|
||||
[node name="TabButtons" type="HBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher" unique_id=454550378]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="JobsTabButton" type="Button" parent="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=332022453]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Jobs"
|
||||
|
||||
[node name="ShopTabButton" type="Button" parent="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=748682284]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Shop"
|
||||
|
||||
[node name="MenuTabButton" type="Button" parent="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=1414728414]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Menu"
|
||||
|
||||
[node name="MainMargin" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn" unique_id=562508461]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="JobsTab" type="PanelContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=859027615]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cqvjp")
|
||||
|
||||
[node name="JobScroll" type="ScrollContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab" unique_id=1046443254]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab/JobScroll" unique_id=708828708]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
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="JobContainer" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab/JobScroll/MarginContainer" unique_id=1821891785]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="JobCard" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab/JobScroll/MarginContainer/JobContainer" unique_id=1714388686 instance_placeholder="res://Scenes/Job/job_card.tscn"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ShopTab" type="PanelContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=23859514]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_vqjbf")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab" unique_id=1098619767]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ShopTabSwitcher" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/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_vqjbf")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" unique_id=1669205646]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PrintersButton" type="Button" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=96323903]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Printers"
|
||||
|
||||
[node name="FilamentsButton" type="Button" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=659653173]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Filaments"
|
||||
|
||||
[node name="Printers" type="PanelContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1896524960]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_qru7b")
|
||||
script = ExtResource("15_vqjbf")
|
||||
printers_array = Array[ExtResource("16_rdojl")]([ExtResource("17_llrls"), ExtResource("18_8rt22"), ExtResource("19_1ohgd")])
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" unique_id=1757920718]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer" unique_id=64943590]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
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="PrinterList" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer/MarginContainer" unique_id=474412195]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="Filaments" type="PanelContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1891341317]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_mmlst")
|
||||
script = ExtResource("9_mbl0m")
|
||||
filaments_array = Array[ExtResource("10_vy225")]([ExtResource("11_fy0us"), ExtResource("12_fy0us")])
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Filaments" unique_id=1087434821]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Filaments/ScrollContainer" unique_id=1350479691]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
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="FilamentList" type="VBoxContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Filaments/ScrollContainer/MarginContainer" unique_id=1017092781]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="MenuTab" type="PanelContainer" parent="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=526907583]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UiNotification" parent="." unique_id=1468421214 instance=ExtResource("2_s3gqk")]
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 649.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
|
||||
[node name="JobSpawner" type="Timer" parent="." unique_id=1696213535]
|
||||
autostart = true
|
||||
|
||||
[node name="Inventory" type="Node" parent="." unique_id=459920508]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[connection signal="pressed" from="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney" to="." method="_on_debug_money_pressed"]
|
||||
[connection signal="pressed" from="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP" to="." method="_on_debug_xp_pressed"]
|
||||
[connection signal="pressed" from="GameArea/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton" to="." method="_on_debug_button_pressed"]
|
||||
[connection signal="pressed" from="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton" to="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_jobs_tab_button_pressed"]
|
||||
[connection signal="pressed" from="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/ShopTabButton" to="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_shop_tab_button_pressed"]
|
||||
[connection signal="pressed" from="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="GameArea/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"]
|
||||
[connection signal="pressed" from="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"]
|
||||
[connection signal="pressed" from="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="GameArea/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"]
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
extends Control
|
||||
|
||||
@onready var message_label: RichTextLabel = $Base/Margin/Message
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
|
||||
func _ready() -> void:
|
||||
GameData.notification_requested.connect(_on_notification_requested)
|
||||
|
||||
func _on_notification_requested(message: String, color: String) -> void:
|
||||
message_label.text = '[color=%s]%s[/color]' % [color, message]
|
||||
animation_player.play("show_notification")
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://y3jtgv0vknvk
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://c4tdg221rvm53"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y3jtgv0vknvk" path="res://Scenes/UI/ui_notification.gd" id="1_7y7gh"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8qs5e"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Base:position:y")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [-50.0]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Base:modulate:a")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [1.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_np30a"]
|
||||
resource_name = "show_notification"
|
||||
length = 3.0000000000000004
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Base:position:y")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.29999995),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [-50.0, 10.0]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Base:modulate:a")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1.5, 3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [1.0, 1.0, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7ag70"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_8qs5e"),
|
||||
&"show_notification": SubResource("Animation_np30a")
|
||||
}
|
||||
|
||||
[node name="UiNotification" type="Control" unique_id=1468421214]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_7y7gh")
|
||||
|
||||
[node name="Base" type="PanelContainer" parent="." unique_id=870318481]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -79.0
|
||||
offset_top = -50.0
|
||||
offset_right = 79.0
|
||||
offset_bottom = -7.0
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="Margin" type="MarginContainer" parent="Base" unique_id=716680500]
|
||||
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="Message" type="RichTextLabel" parent="Base/Margin" unique_id=438265807]
|
||||
layout_mode = 2
|
||||
bbcode_enabled = true
|
||||
text = "Example message"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=152270752]
|
||||
libraries/ = SubResource("AnimationLibrary_7ag70")
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
extends MarginContainer
|
||||
|
||||
@onready var jobs_tab_button: Button = $TabButtons/JobsTabButton
|
||||
@onready var shop_tab_button: Button = $TabButtons/ShopTabButton
|
||||
@onready var menu_tab_button: Button = $TabButtons/MenuTabButton
|
||||
|
||||
func _ready() -> void:
|
||||
%JobsTab.visible = true
|
||||
%ShopTab.visible = false
|
||||
%MenuTab.visible = false
|
||||
disable_buttons("jobs")
|
||||
|
||||
func _on_jobs_tab_button_pressed() -> void:
|
||||
%JobsTab.visible = true
|
||||
%ShopTab.visible = false
|
||||
%MenuTab.visible = false
|
||||
disable_buttons("jobs")
|
||||
|
||||
func _on_shop_tab_button_pressed() -> void:
|
||||
%JobsTab.visible = false
|
||||
%ShopTab.visible = true
|
||||
%MenuTab.visible = false
|
||||
disable_buttons("shop")
|
||||
|
||||
func _on_menu_tab_button_pressed() -> void:
|
||||
%JobsTab.visible = false
|
||||
%ShopTab.visible = false
|
||||
%MenuTab.visible = true
|
||||
disable_buttons("menu")
|
||||
|
||||
func disable_buttons(tab: String) -> void:
|
||||
jobs_tab_button.disabled = true
|
||||
shop_tab_button.disabled = true
|
||||
menu_tab_button.disabled = true
|
||||
|
||||
match tab:
|
||||
"jobs":
|
||||
shop_tab_button.disabled = false
|
||||
menu_tab_button.disabled = false
|
||||
"shop":
|
||||
jobs_tab_button.disabled = false
|
||||
menu_tab_button.disabled = false
|
||||
"menu":
|
||||
jobs_tab_button.disabled = false
|
||||
shop_tab_button.disabled = false
|
||||
|
|
@ -8,11 +8,10 @@ name="Linux"
|
|||
platform="Linux"
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="scenes"
|
||||
export_files=PackedStringArray("res://Scenes/Map/Map.tscn", "res://Scenes/Map/map_tile.tscn")
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="Releases/PrintingSim-stable"
|
||||
export_path="Releases/PrintingSim-v0.1"
|
||||
patches=PackedStringArray()
|
||||
patch_delta_encoding=false
|
||||
patch_delta_compression_level_zstd=19
|
||||
|
|
|
|||
21
godot-git-plugin-v3.2.1/addons/godot-git-plugin/LICENSE
Normal file
21
godot-git-plugin-v3.2.1/addons/godot-git-plugin/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2016-2023 The Godot Engine community
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1346
godot-git-plugin-v3.2.1/addons/godot-git-plugin/THIRDPARTY.md
Normal file
1346
godot-git-plugin-v3.2.1/addons/godot-git-plugin/THIRDPARTY.md
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,10 @@
|
|||
[configuration]
|
||||
|
||||
entry_symbol = "git_plugin_init"
|
||||
compatibility_minimum = "4.2.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
|
||||
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
|
||||
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://b208shhnkfnh3
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
godot-git-plugin-v3.2.1/addons/jepsuhub-tokens.txt
Normal file
2
godot-git-plugin-v3.2.1/addons/jepsuhub-tokens.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
godot-mainpc: b7bb31ea02eee907534e614b3e9e34af74ce5bed
|
||||
test
|
||||
|
|
@ -11,11 +11,7 @@ var job_material: String
|
|||
@onready var job_experience: Label = $MarginContainer/VBoxContainer/HBoxContainer3/PartExperience
|
||||
@onready var job_time_label: Label = $MarginContainer/VBoxContainer/HBoxContainer/TimeLabel
|
||||
@onready var job_material_label: Label = $MarginContainer/VBoxContainer/HBoxContainer2/PartMaterial
|
||||
@onready var skip_job_button: Button = $MarginContainer/VBoxContainer/HBoxContainer/SkipJob
|
||||
|
||||
func _ready() -> void:
|
||||
PlayerData.owned_printers_changed.connect(_on_owned_printers_changed)
|
||||
_on_owned_printers_changed(PlayerData.owned_printers)
|
||||
|
||||
func initialize_job(data: JobData) -> void:
|
||||
job_data = data
|
||||
|
|
@ -41,16 +37,8 @@ func calculate_time() -> String:
|
|||
else:
|
||||
return '%.2f s' % round_time
|
||||
|
||||
func _on_owned_printers_changed(owned_printers: int) -> void:
|
||||
if owned_printers == 0:
|
||||
skip_job_button.disabled = true
|
||||
return
|
||||
skip_job_button.disabled = false
|
||||
|
||||
func _on_accept_job_pressed() -> void:
|
||||
job_accepted.emit(self)
|
||||
GameData.refresh_printer_dropdown.emit()
|
||||
|
||||
func _on_skip_job_pressed() -> void:
|
||||
queue_free()
|
||||
GameData.current_job_count -= 1
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
[gd_scene format=3 uid="uid://dvfcie8hqcb0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://wjam0w8dmel3" path="res://Scenes/Job/job_card.gd" id="1_hdanx"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_g1ftk"]
|
||||
[ext_resource type="StyleBox" uid="uid://b0kxbbhtsbhcr" path="res://Styles/btn_style_box_red_hover.tres" id="3_hj6y5"]
|
||||
[ext_resource type="Script" uid="uid://wjam0w8dmel3" path="res://job_card.gd" id="1_vsles"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_4nwb4"]
|
||||
[ext_resource type="StyleBox" uid="uid://b0kxbbhtsbhcr" path="res://Styles/btn_style_box_red_hover.tres" id="3_h28cc"]
|
||||
|
||||
[node name="JobCard" type="PanelContainer" unique_id=1714388686]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("1_hdanx")
|
||||
script = ExtResource("1_vsles")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2020543953]
|
||||
layout_mode = 2
|
||||
|
|
@ -47,7 +47,7 @@ text = "Amount: 1"
|
|||
[node name="AcceptJob" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer3" unique_id=1475207118]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/hover = ExtResource("2_g1ftk")
|
||||
theme_override_styles/hover = ExtResource("2_4nwb4")
|
||||
text = "Accept"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1428599849]
|
||||
|
|
@ -67,7 +67,7 @@ text = "Time: 3 min"
|
|||
[node name="SkipJob" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1848796901]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/hover = ExtResource("3_hj6y5")
|
||||
theme_override_styles/hover = ExtResource("3_h28cc")
|
||||
text = "Skip"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer3/AcceptJob" to="." method="_on_accept_job_pressed"]
|
||||
49
player_data.gd
Normal file
49
player_data.gd
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
extends Node
|
||||
|
||||
@export var xp: float = 0:
|
||||
set(value):
|
||||
xp = value
|
||||
xp_changed.emit(xp)
|
||||
|
||||
@export var money: float = 500:
|
||||
set(value):
|
||||
money = value
|
||||
money_changed.emit(money)
|
||||
|
||||
@export var level: int = 0:
|
||||
set(value):
|
||||
level = value
|
||||
level_changed.emit(level)
|
||||
|
||||
@export var sell_multiplier: float = 0.5
|
||||
|
||||
var jobs: Array[JobData]
|
||||
|
||||
signal xp_changed(new_xp)
|
||||
signal money_changed(new_money)
|
||||
signal level_changed(new_level)
|
||||
|
||||
signal give_experience(xp_amount)
|
||||
signal give_money(money_amount)
|
||||
|
||||
func _ready() -> void:
|
||||
give_experience.connect(_on_give_experience)
|
||||
give_money.connect(_on_give_money)
|
||||
|
||||
func _on_give_experience(amount: float) -> void:
|
||||
print('Gave: %.0f xp' % amount)
|
||||
xp += amount
|
||||
if xp >= 100:
|
||||
while xp >= 100:
|
||||
level += 1
|
||||
xp -= 100
|
||||
|
||||
func _on_give_money(amount: float) -> void:
|
||||
money += amount
|
||||
|
||||
func try_purchase(amount) -> bool:
|
||||
if amount <= money:
|
||||
money -= amount
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
106
printer.gd
Normal file
106
printer.gd
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
extends PanelContainer
|
||||
|
||||
@onready var printer_name_label: Label = $MarginContainer/MainArea/TopInfo/PrinterLabel
|
||||
@onready var printer_model_label: Label = $MarginContainer/MainArea/PrinterModelLabel
|
||||
@onready var progress_bar: ProgressBar = $MarginContainer/MainArea/PrintInfo/ProgressBar
|
||||
@onready var select_job: OptionButton = $MarginContainer/MainArea/SelectJob
|
||||
@onready var status_label: Label = $MarginContainer/MainArea/TopInfo/StatusLabel
|
||||
@onready var time_left_label: Label = $MarginContainer/MainArea/PrintInfo/TimeLeftLabel
|
||||
@onready var start_button: Button = $MarginContainer/MainArea/Buttons/StartButton
|
||||
|
||||
var printer_data: PrinterData
|
||||
var selected_job: JobData
|
||||
var selected_job_index: int
|
||||
var is_printing: bool = false
|
||||
var time_left: float
|
||||
|
||||
func initialize_printer(data: PrinterData) -> void:
|
||||
printer_data = data
|
||||
printer_name_label.text = printer_data.printer_manufacturer
|
||||
printer_model_label.text = printer_data.printer_type
|
||||
time_left_label.visible = false
|
||||
set_status()
|
||||
progress_bar.visible = false
|
||||
progress_bar.value = 0
|
||||
_on_select_job_pressed()
|
||||
|
||||
func _process(delta) -> void:
|
||||
if is_printing:
|
||||
select_job.disabled = true
|
||||
progress_bar.visible = true
|
||||
time_left_label.visible = true
|
||||
set_status()
|
||||
var total_time = selected_job.job_time
|
||||
var progress = (total_time - time_left) / total_time
|
||||
time_left -= delta
|
||||
progress_bar.value = progress
|
||||
time_left_label.text = 'Time left: %s' % calculate_time_left(time_left)
|
||||
|
||||
if time_left <= 0:
|
||||
PlayerData.give_money.emit(selected_job.job_reward)
|
||||
PlayerData.give_experience.emit(selected_job.job_experience)
|
||||
if PlayerData.jobs.size() == 1:
|
||||
PlayerData.jobs.clear()
|
||||
else:
|
||||
PlayerData.jobs.remove_at(selected_job_index)
|
||||
reset_status()
|
||||
|
||||
func reset_status() -> void:
|
||||
is_printing = false
|
||||
_on_select_job_pressed()
|
||||
set_status()
|
||||
time_left_label.visible = false
|
||||
progress_bar.visible = false
|
||||
progress_bar.value = 0
|
||||
select_job.disabled = false
|
||||
|
||||
func set_status() -> void:
|
||||
if is_printing:
|
||||
status_label.text = 'Status: Printing'
|
||||
else:
|
||||
status_label.text = 'Status: Free'
|
||||
|
||||
func calculate_time_left(time) -> String:
|
||||
var minutes: int = 0
|
||||
|
||||
if time >= 60:
|
||||
while time >= 60:
|
||||
minutes += 1
|
||||
time -= 60
|
||||
return '%d m %.2f s' % [minutes, time]
|
||||
else:
|
||||
return '%.2f s' % time
|
||||
|
||||
func _on_sell_button_pressed() -> void:
|
||||
PlayerData.give_money.emit(printer_data.printer_price * PlayerData.sell_multiplier)
|
||||
queue_free()
|
||||
|
||||
func _on_select_job_pressed() -> void:
|
||||
select_job.clear()
|
||||
|
||||
if PlayerData.jobs.is_empty():
|
||||
select_job.add_item("No jobs accepted")
|
||||
start_button.disabled = true
|
||||
else:
|
||||
start_button.disabled = false
|
||||
for job in PlayerData.jobs:
|
||||
var item_text = '%s (XP: %d | %d € | %s)' % [job.job_name, job.job_experience, job.job_reward, calculate_time_left(job.job_time)]
|
||||
select_job.add_item(item_text)
|
||||
|
||||
var current_index = select_job.item_count - 1
|
||||
select_job.set_item_metadata(current_index, job)
|
||||
selected_job = select_job.get_item_metadata(0)
|
||||
selected_job_index = 0
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
if select_job.get_item_text(0) == "No jobs accepted":
|
||||
print("No job selected")
|
||||
else:
|
||||
time_left = selected_job.job_time
|
||||
is_printing = true
|
||||
|
||||
_on_select_job_pressed()
|
||||
|
||||
func _on_select_job_item_selected(index: int) -> void:
|
||||
selected_job = select_job.get_item_metadata(index)
|
||||
selected_job_index = index
|
||||
|
|
@ -1,18 +1,15 @@
|
|||
[gd_scene format=3 uid="uid://33ctlyrpibs3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dj7pngpg53qdb" path="res://Scenes/Printer/printer.gd" id="1_dlbos"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_dlbos"]
|
||||
[ext_resource type="StyleBox" uid="uid://b0kxbbhtsbhcr" path="res://Styles/btn_style_box_red_hover.tres" id="3_mmlst"]
|
||||
[ext_resource type="Script" uid="uid://dj7pngpg53qdb" path="res://printer.gd" id="1_jhpce"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_tnxmo"]
|
||||
[ext_resource type="StyleBox" uid="uid://b0kxbbhtsbhcr" path="res://Styles/btn_style_box_red_hover.tres" id="3_vtisp"]
|
||||
|
||||
[node name="Printer" type="PanelContainer" unique_id=1372437203]
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
offset_right = 271.0
|
||||
offset_bottom = 182.0
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("1_dlbos")
|
||||
script = ExtResource("1_jhpce")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1159449756]
|
||||
layout_mode = 2
|
||||
|
|
@ -33,68 +30,29 @@ size_flags_horizontal = 3
|
|||
theme_override_font_sizes/font_size = 30
|
||||
text = "Printer #1"
|
||||
|
||||
[node name="StatusLabel" type="RichTextLabel" parent="MarginContainer/MainArea/TopInfo" unique_id=157586427]
|
||||
[node name="StatusLabel" type="Label" parent="MarginContainer/MainArea/TopInfo" unique_id=2117616913]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Status: Free"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Model" type="HBoxContainer" parent="MarginContainer/MainArea" unique_id=916690802]
|
||||
[node name="PrinterModelLabel" type="Label" parent="MarginContainer/MainArea" unique_id=666140345]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PrinterModelLabel" type="Label" parent="MarginContainer/MainArea/Model" unique_id=666140345]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Printer model"
|
||||
|
||||
[node name="PrintInfo" type="VBoxContainer" parent="MarginContainer/MainArea" unique_id=1502076264]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InfoRow1" type="HBoxContainer" parent="MarginContainer/MainArea/PrintInfo" unique_id=1561257387]
|
||||
[node name="FilamentLabel" type="Label" parent="MarginContainer/MainArea/PrintInfo" unique_id=181392172]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "Material: PLA"
|
||||
|
||||
[node name="LoadedFilament" type="RichTextLabel" parent="MarginContainer/MainArea/PrintInfo/InfoRow1" unique_id=532233684]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Loaded filament: XXX | XXX g"
|
||||
|
||||
[node name="QualityLabel" type="RichTextLabel" parent="MarginContainer/MainArea/PrintInfo/InfoRow1" unique_id=937206053]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Print quality: ###%"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/MainArea/PrintInfo/InfoRow1" unique_id=1388403149]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InfoRow2" type="HBoxContainer" parent="MarginContainer/MainArea/PrintInfo" unique_id=719967546]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TimeLeftLabel" type="RichTextLabel" parent="MarginContainer/MainArea/PrintInfo/InfoRow2" unique_id=948453921]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Time left: ###s"
|
||||
|
||||
[node name="RewardLabel" type="RichTextLabel" parent="MarginContainer/MainArea/PrintInfo/InfoRow2" unique_id=700892606]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
text = "Reward: ###€"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/MainArea/PrintInfo/InfoRow2" unique_id=1668802451]
|
||||
[node name="TimeLeftLabel" type="Label" parent="MarginContainer/MainArea/PrintInfo" unique_id=1516591173]
|
||||
layout_mode = 2
|
||||
text = "Time left: 15.0"
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/MainArea/PrintInfo" unique_id=768246659]
|
||||
layout_mode = 2
|
||||
theme_override_styles/fill = ExtResource("2_dlbos")
|
||||
max_value = 1.0
|
||||
|
||||
[node name="Buttons" type="HBoxContainer" parent="MarginContainer/MainArea" unique_id=248340191]
|
||||
|
|
@ -103,7 +61,7 @@ layout_mode = 2
|
|||
[node name="StartButton" type="Button" parent="MarginContainer/MainArea/Buttons" unique_id=1943803675]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/hover = ExtResource("2_dlbos")
|
||||
theme_override_styles/hover = ExtResource("2_tnxmo")
|
||||
text = "Start print"
|
||||
|
||||
[node name="UpgradeButton" type="Button" parent="MarginContainer/MainArea/Buttons" unique_id=765929805]
|
||||
|
|
@ -115,14 +73,9 @@ text = "Upgrade"
|
|||
[node name="SellButton" type="Button" parent="MarginContainer/MainArea/Buttons" unique_id=929234066]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/hover = ExtResource("3_mmlst")
|
||||
theme_override_styles/hover = ExtResource("3_vtisp")
|
||||
text = "Sell printer"
|
||||
|
||||
[node name="SelectFilament" type="OptionButton" parent="MarginContainer/MainArea" unique_id=1562930238]
|
||||
layout_mode = 2
|
||||
item_count = 1
|
||||
popup/item_0/id = 0
|
||||
|
||||
[node name="SelectJob" type="OptionButton" parent="MarginContainer/MainArea" unique_id=1500040832]
|
||||
layout_mode = 2
|
||||
|
||||
|
|
@ -130,7 +83,5 @@ layout_mode = 2
|
|||
|
||||
[connection signal="pressed" from="MarginContainer/MainArea/Buttons/StartButton" to="." method="_on_start_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/MainArea/Buttons/SellButton" to="." method="_on_sell_button_pressed"]
|
||||
[connection signal="item_selected" from="MarginContainer/MainArea/SelectFilament" to="." method="_on_select_filament_item_selected"]
|
||||
[connection signal="pressed" from="MarginContainer/MainArea/SelectFilament" to="." method="_on_select_filament_pressed"]
|
||||
[connection signal="item_selected" from="MarginContainer/MainArea/SelectJob" to="." method="_on_select_job_item_selected"]
|
||||
[connection signal="pressed" from="MarginContainer/MainArea/SelectJob" to="." method="_on_select_job_pressed"]
|
||||
|
|
@ -17,11 +17,11 @@ 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: %d/5' % roundf(printer_data.printer_speed)
|
||||
printer_quality.text = 'Quality: %d/5' % roundf(printer_data.printer_quality)
|
||||
printer_price.text = 'Price: %d €' % printer_data.printer_price
|
||||
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) + "€"
|
||||
|
||||
if PlayerData.money >= printer_data.printer_price:
|
||||
if PlayerData.money > printer_data.printer_price:
|
||||
buy_button.disabled = false
|
||||
else:
|
||||
buy_button.disabled = true
|
||||
|
|
@ -31,7 +31,7 @@ func _on_buy_button_pressed() -> void:
|
|||
print("Shop tab printer clicked: " + self.printer_data.printer_manufacturer)
|
||||
|
||||
func _on_toggle_button(money) -> void:
|
||||
if PlayerData.money >= printer_data.printer_price:
|
||||
if PlayerData.money > printer_data.printer_price:
|
||||
buy_button.disabled = false
|
||||
else:
|
||||
buy_button.disabled = true
|
||||
16
printers.gd
Normal file
16
printers.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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):
|
||||
printer_purchase_requested.emit(bought_printer.printer_data)
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
[gd_scene format=3 uid="uid://bdpqvwvwmaian"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ttfk4n2fkifj" path="res://Scenes/Shop/Printers/shop_printer_card.gd" id="1_tl8ce"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_tl8ce"]
|
||||
[ext_resource type="Script" uid="uid://ttfk4n2fkifj" path="res://printer_card.gd" id="1_5nuqd"]
|
||||
[ext_resource type="StyleBox" uid="uid://csahw36txnewl" path="res://Styles/btn_style_box_green_hover.tres" id="2_22or4"]
|
||||
|
||||
[node name="PrinterCard" type="PanelContainer" unique_id=1714388686]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("1_tl8ce")
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("1_5nuqd")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=2020543953]
|
||||
layout_mode = 2
|
||||
|
|
@ -59,7 +55,7 @@ text = "Price: 500 €"
|
|||
[node name="BuyButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer" unique_id=1475207118]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/hover = ExtResource("2_tl8ce")
|
||||
theme_override_styles/hover = ExtResource("2_22or4")
|
||||
text = "Buy"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/BuyButton" to="." method="_on_buy_button_pressed"]
|
||||
|
|
@ -18,7 +18,11 @@ config/icon="res://icon.svg"
|
|||
[autoload]
|
||||
|
||||
PlayerData="*uid://5g1fp4otancm"
|
||||
GameData="*uid://d3abg1dpwrkmq"
|
||||
|
||||
[editor]
|
||||
|
||||
version_control/plugin_name="GitPlugin"
|
||||
version_control/autoload_on_startup=true
|
||||
|
||||
[physics]
|
||||
|
||||
|
|
@ -28,4 +32,3 @@ GameData="*uid://d3abg1dpwrkmq"
|
|||
|
||||
rendering_device/driver.windows="d3d12"
|
||||
renderer/rendering_method="mobile"
|
||||
environment/defaults/default_clear_color=Color(0, 0, 0, 1)
|
||||
|
|
|
|||
13
shop_tab_switcher.gd
Normal file
13
shop_tab_switcher.gd
Normal 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
|
||||
21
tab_switcher.gd
Normal file
21
tab_switcher.gd
Normal 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
|
||||
88
ui.gd
Normal file
88
ui.gd
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
extends Control
|
||||
|
||||
@export var jobs_array: Array[JobData]
|
||||
@export var job_limit: int = 5
|
||||
@export var debug: bool = false
|
||||
var jobs_tab_button: Button
|
||||
|
||||
@onready var debug_xp: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP
|
||||
@onready var debug_money: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney
|
||||
@onready var debug_button: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton
|
||||
|
||||
const JOB_SCENE = preload("uid://dvfcie8hqcb0")
|
||||
const PRINTER = preload("uid://33ctlyrpibs3")
|
||||
|
||||
func _ready() -> void:
|
||||
check_debug()
|
||||
|
||||
%Money.text = "Money: " + str(PlayerData.money) + " €"
|
||||
%Experience.value = PlayerData.xp
|
||||
%Level.text = "Level: " + str(PlayerData.level)
|
||||
jobs_tab_button = $VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton
|
||||
|
||||
PlayerData.xp_changed.connect(_on_xp_changed)
|
||||
PlayerData.level_changed.connect(_on_level_changed)
|
||||
PlayerData.money_changed.connect(_on_money_changed)
|
||||
|
||||
func generate_job():
|
||||
var job_count = %JobContainer.get_children()
|
||||
|
||||
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)
|
||||
|
||||
# --- Experience, Level and Money update ---
|
||||
func _on_xp_changed(xp):
|
||||
%Experience.value = xp
|
||||
func _on_level_changed(level):
|
||||
%Level.text = "Level: " + str(level)
|
||||
func _on_money_changed(money):
|
||||
%Money.text = "Money: " + str(money) + "€"
|
||||
|
||||
func _on_job_accepted_pressed(accepted_job):
|
||||
print("Job accepted")
|
||||
PlayerData.jobs.append(accepted_job.job_data)
|
||||
print(PlayerData.jobs[0].job_name)
|
||||
|
||||
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 _on_printers_printer_purchase_requested(printer_data: PrinterData) -> void:
|
||||
if PlayerData.try_purchase(printer_data.printer_price):
|
||||
%Money.text = "Money: " + str(PlayerData.money) + "€"
|
||||
var new_printer = PRINTER.instantiate()
|
||||
%PrinterContainer.add_child(new_printer)
|
||||
new_printer.initialize_printer(printer_data)
|
||||
|
||||
func check_debug() -> void:
|
||||
debug_xp.visible = false
|
||||
debug_money.visible = false
|
||||
if debug:
|
||||
debug_xp.visible = true
|
||||
debug_money.visible = true
|
||||
|
||||
func _on_debug_money_pressed() -> void:
|
||||
PlayerData.give_money.emit(100)
|
||||
|
||||
func _on_debug_xp_pressed() -> void:
|
||||
var xp = randf() * 100
|
||||
PlayerData.give_experience.emit(xp)
|
||||
|
||||
func _on_debug_button_pressed() -> void:
|
||||
toggle_debug()
|
||||
|
||||
func toggle_debug() -> void:
|
||||
if debug == true:
|
||||
debug = false
|
||||
else:
|
||||
debug = true
|
||||
check_debug()
|
||||
229
ui.tscn
Normal file
229
ui.tscn
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
[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"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8fchy"]
|
||||
bg_color = Color(0.3529412, 0.47843137, 0.7372549, 0.47058824)
|
||||
corner_radius_top_left = 6
|
||||
corner_radius_top_right = 6
|
||||
corner_radius_bottom_right = 6
|
||||
corner_radius_bottom_left = 6
|
||||
corner_detail = 6
|
||||
|
||||
[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="DebugMoney" type="Button" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=601739475]
|
||||
layout_mode = 2
|
||||
text = "Give 100€"
|
||||
|
||||
[node name="DebugXP" type="Button" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=535993224]
|
||||
layout_mode = 2
|
||||
text = "Give xp"
|
||||
|
||||
[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="DebugButton" type="Button" parent="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer" unique_id=255003152]
|
||||
layout_mode = 2
|
||||
text = "Debug"
|
||||
|
||||
[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
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_8fchy")
|
||||
value = 65.27
|
||||
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]
|
||||
visible = false
|
||||
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]
|
||||
autostart = true
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney" to="." method="_on_debug_money_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP" to="." method="_on_debug_xp_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton" to="." method="_on_debug_button_pressed"]
|
||||
[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"]
|
||||
Loading…
Reference in a new issue