Compare commits
No commits in common. "a540ae1f83f939d49bf6cae5a0d49fe5a14b3993" and "81610a3cb06f11a7a43f42ec21a5ad3ce346a8d5" have entirely different histories.
a540ae1f83
...
81610a3cb0
15 changed files with 26 additions and 120 deletions
|
|
@ -8,6 +8,5 @@ printer_manufacturer = "Bambulab"
|
||||||
printer_type = "A1 Mini"
|
printer_type = "A1 Mini"
|
||||||
printer_speed = 4.0
|
printer_speed = 4.0
|
||||||
printer_quality = 3.5
|
printer_quality = 3.5
|
||||||
printer_level_req = 5
|
|
||||||
printer_price = 350.0
|
printer_price = 350.0
|
||||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
script = ExtResource("1_nuksd")
|
script = ExtResource("1_nuksd")
|
||||||
printer_manufacturer = "Creality"
|
printer_manufacturer = "Creality"
|
||||||
printer_type = "Ender-3 V3 SE"
|
printer_type = "Ender-3 V3 SE"
|
||||||
printer_speed = 1.0
|
printer_speed = 2.0
|
||||||
printer_quality = 1.0
|
printer_quality = 2.0
|
||||||
printer_price = 200.0
|
printer_price = 200.0
|
||||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,5 @@ printer_manufacturer = "Prusa Research"
|
||||||
printer_type = "MK4S"
|
printer_type = "MK4S"
|
||||||
printer_speed = 4.5
|
printer_speed = 4.5
|
||||||
printer_quality = 5.0
|
printer_quality = 5.0
|
||||||
printer_level_req = 10
|
|
||||||
printer_price = 850.0
|
printer_price = 850.0
|
||||||
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
metadata/_custom_type_script = "uid://bed8wdnwod4wu"
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,4 @@ extends Resource
|
||||||
@export var printer_type: String
|
@export var printer_type: String
|
||||||
@export_range(1, 5) var printer_speed: float
|
@export_range(1, 5) var printer_speed: float
|
||||||
@export_range(1, 5) var printer_quality: float
|
@export_range(1, 5) var printer_quality: float
|
||||||
@export var printer_level_req: int = 1
|
|
||||||
@export var printer_price: float
|
@export var printer_price: float
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ func _on_shop_printer_purchase_req(printer_data: PrinterData) -> void:
|
||||||
var new_printer = PRINTER.instantiate()
|
var new_printer = PRINTER.instantiate()
|
||||||
printer_bought.emit(new_printer)
|
printer_bought.emit(new_printer)
|
||||||
new_printer.initialize_printer(printer_data)
|
new_printer.initialize_printer(printer_data)
|
||||||
PlayerData.owned_printers += 1
|
|
||||||
|
|
||||||
|
|
||||||
#region Job generation
|
#region Job generation
|
||||||
|
|
@ -78,7 +77,9 @@ func generate_random_job() -> JobData:
|
||||||
new_job.job_difficulty = random_job.job_difficulty
|
new_job.job_difficulty = random_job.job_difficulty
|
||||||
new_job.job_amount = roundf(amount)
|
new_job.job_amount = roundf(amount)
|
||||||
|
|
||||||
#print('Generated new job: %s (%d € | %d xp | %d pcs)' % [new_job.job_name, new_job.job_reward, new_job.job_experience, new_job.job_amount])
|
#print('Random amount: %.2f' % amount)
|
||||||
|
#print('Job amount: %.2f' % new_job.job_amount)
|
||||||
|
print('Generated new job: %s (%d € | %d xp | %d pcs)' % [new_job.job_name, new_job.job_reward, new_job.job_experience, new_job.job_amount])
|
||||||
return new_job
|
return new_job
|
||||||
|
|
||||||
func _on_job_accepted_pressed(accepted_job) -> void:
|
func _on_job_accepted_pressed(accepted_job) -> void:
|
||||||
|
|
|
||||||
|
|
@ -5,26 +5,21 @@ var xp: float = 0:
|
||||||
xp = value
|
xp = value
|
||||||
xp_changed.emit(xp)
|
xp_changed.emit(xp)
|
||||||
|
|
||||||
var money: float = 200:
|
var money: float = 500:
|
||||||
set(value):
|
set(value):
|
||||||
money = value
|
money = value
|
||||||
money_changed.emit(money)
|
money_changed.emit(money)
|
||||||
|
|
||||||
var level: int = 1:
|
var level: int = 0:
|
||||||
set(value):
|
set(value):
|
||||||
level = value
|
level = value
|
||||||
level_changed.emit(level)
|
level_changed.emit(level)
|
||||||
|
|
||||||
var max_order_amount: int = 3:
|
var max_order_amount: int = 10:
|
||||||
set(value):
|
set(value):
|
||||||
max_order_amount = value
|
max_order_amount = value
|
||||||
max_order_amount_changed.emit(max_order_amount)
|
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
|
var sell_multiplier: float = 0.5
|
||||||
|
|
||||||
var jobs: Array[JobData]
|
var jobs: Array[JobData]
|
||||||
|
|
@ -34,7 +29,6 @@ signal xp_changed(new_xp)
|
||||||
signal money_changed(new_money)
|
signal money_changed(new_money)
|
||||||
signal level_changed(new_level)
|
signal level_changed(new_level)
|
||||||
signal max_order_amount_changed(new_max_order_amount)
|
signal max_order_amount_changed(new_max_order_amount)
|
||||||
signal owned_printers_changed(new_amount)
|
|
||||||
|
|
||||||
# Signal - functions
|
# Signal - functions
|
||||||
signal give_experience(xp_amount)
|
signal give_experience(xp_amount)
|
||||||
|
|
@ -47,23 +41,14 @@ func _ready() -> void:
|
||||||
func _on_give_experience(amount: float) -> void:
|
func _on_give_experience(amount: float) -> void:
|
||||||
print('Gave: %.0f xp' % amount)
|
print('Gave: %.0f xp' % amount)
|
||||||
xp += amount
|
xp += amount
|
||||||
|
if xp >= 100:
|
||||||
while xp >= xp_required_for_level(level):
|
while xp >= 100:
|
||||||
xp -= xp_required_for_level(level)
|
|
||||||
level += 1
|
level += 1
|
||||||
|
xp -= 100
|
||||||
|
|
||||||
func _on_give_money(amount: float) -> void:
|
func _on_give_money(amount: float) -> void:
|
||||||
money += amount
|
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:
|
func try_purchase(amount) -> bool:
|
||||||
if amount <= money:
|
if amount <= money:
|
||||||
money -= amount
|
money -= amount
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,7 @@ var job_material: String
|
||||||
@onready var job_experience: Label = $MarginContainer/VBoxContainer/HBoxContainer3/PartExperience
|
@onready var job_experience: Label = $MarginContainer/VBoxContainer/HBoxContainer3/PartExperience
|
||||||
@onready var job_time_label: Label = $MarginContainer/VBoxContainer/HBoxContainer/TimeLabel
|
@onready var job_time_label: Label = $MarginContainer/VBoxContainer/HBoxContainer/TimeLabel
|
||||||
@onready var job_material_label: Label = $MarginContainer/VBoxContainer/HBoxContainer2/PartMaterial
|
@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:
|
func initialize_job(data: JobData) -> void:
|
||||||
job_data = data
|
job_data = data
|
||||||
|
|
@ -41,12 +37,6 @@ func calculate_time() -> String:
|
||||||
else:
|
else:
|
||||||
return '%.2f s' % round_time
|
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:
|
func _on_accept_job_pressed() -> void:
|
||||||
job_accepted.emit(self)
|
job_accepted.emit(self)
|
||||||
GameData.refresh_printer_dropdown.emit()
|
GameData.refresh_printer_dropdown.emit()
|
||||||
|
|
|
||||||
|
|
@ -50,14 +50,14 @@ func _process(delta) -> void:
|
||||||
|
|
||||||
func reset_status() -> void:
|
func reset_status() -> void:
|
||||||
is_printing = false
|
is_printing = false
|
||||||
|
_on_select_job_pressed()
|
||||||
|
set_status()
|
||||||
time_left_label.visible = false
|
time_left_label.visible = false
|
||||||
progress_bar.visible = false
|
progress_bar.visible = false
|
||||||
progress_bar.value = 0
|
progress_bar.value = 0
|
||||||
time_left = 0
|
time_left = 0
|
||||||
select_job.disabled = false
|
select_job.disabled = false
|
||||||
start_button.disabled = false
|
start_button.disabled = false
|
||||||
_on_select_job_pressed()
|
|
||||||
set_status()
|
|
||||||
|
|
||||||
func set_status() -> void:
|
func set_status() -> void:
|
||||||
if is_printing:
|
if is_printing:
|
||||||
|
|
@ -84,7 +84,6 @@ func _on_refresh_printer_dropdown() -> void:
|
||||||
|
|
||||||
func _on_sell_button_pressed() -> void:
|
func _on_sell_button_pressed() -> void:
|
||||||
PlayerData.give_money.emit(printer_data.printer_price * PlayerData.sell_multiplier)
|
PlayerData.give_money.emit(printer_data.printer_price * PlayerData.sell_multiplier)
|
||||||
PlayerData.owned_printers -= 1
|
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
func _on_select_job_pressed() -> void:
|
func _on_select_job_pressed() -> void:
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ text = "Time left: 15.0"
|
||||||
|
|
||||||
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/MainArea/PrintInfo" unique_id=768246659]
|
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/MainArea/PrintInfo" unique_id=768246659]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_styles/fill = ExtResource("2_dlbos")
|
|
||||||
max_value = 1.0
|
max_value = 1.0
|
||||||
|
|
||||||
[node name="Buttons" type="HBoxContainer" parent="MarginContainer/MainArea" unique_id=248340191]
|
[node name="Buttons" type="HBoxContainer" parent="MarginContainer/MainArea" unique_id=248340191]
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ func initialize_printer(data: PrinterData) -> void:
|
||||||
printer_data = data
|
printer_data = data
|
||||||
printer_name.text = printer_data.printer_manufacturer
|
printer_name.text = printer_data.printer_manufacturer
|
||||||
printer_model.text = printer_data.printer_type
|
printer_model.text = printer_data.printer_type
|
||||||
printer_speed.text = 'Speed: %d/5' % roundf(printer_data.printer_speed)
|
printer_speed.text = 'Speed: %d/5' % printer_data.printer_speed
|
||||||
printer_quality.text = 'Quality: %d/5' % roundf(printer_data.printer_quality)
|
printer_quality.text = 'Quality: %d/5' % printer_data.printer_quality
|
||||||
printer_price.text = 'Price: %d €' % printer_data.printer_price
|
printer_price.text = 'Price: %d €' % printer_data.printer_price
|
||||||
|
|
||||||
if PlayerData.money >= printer_data.printer_price:
|
if PlayerData.money >= printer_data.printer_price:
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ const PRINTER_SCENE = preload("uid://bdpqvwvwmaian")
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
generate_printers()
|
generate_printers()
|
||||||
|
generate_printers()
|
||||||
|
|
||||||
printer_purchase_requested.connect(GameData._on_shop_printer_purchase_req)
|
printer_purchase_requested.connect(GameData._on_shop_printer_purchase_req)
|
||||||
|
|
||||||
func generate_printers() -> void:
|
func generate_printers() -> void:
|
||||||
for printer in printers_array:
|
for printer in printers_array:
|
||||||
if PlayerData.level >= printer.printer_level_req:
|
|
||||||
var new_printer = PRINTER_SCENE.instantiate()
|
var new_printer = PRINTER_SCENE.instantiate()
|
||||||
%PrinterList.add_child(new_printer)
|
%PrinterList.add_child(new_printer)
|
||||||
new_printer.initialize_printer(printer)
|
new_printer.initialize_printer(printer)
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,13 @@
|
||||||
extends MarginContainer
|
extends MarginContainer
|
||||||
|
|
||||||
@onready var printers_button: Button = $HBoxContainer/PrintersButton
|
|
||||||
@onready var filaments_button: Button = $HBoxContainer/FilamentsButton
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
%Printers.visible = true
|
%Printers.visible = true
|
||||||
%Filaments.visible = false
|
%Filaments.visible = false
|
||||||
disable_buttons("printers")
|
|
||||||
|
|
||||||
func _on_printers_button_pressed() -> void:
|
func _on_printers_button_pressed() -> void:
|
||||||
%Printers.visible = true
|
%Printers.visible = true
|
||||||
%Filaments.visible = false
|
%Filaments.visible = false
|
||||||
disable_buttons("printers")
|
|
||||||
|
|
||||||
func _on_filaments_button_pressed() -> void:
|
func _on_filaments_button_pressed() -> void:
|
||||||
%Printers.visible = false
|
%Printers.visible = false
|
||||||
%Filaments.visible = true
|
%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
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,9 @@ func _ready() -> void:
|
||||||
|
|
||||||
# --- Experience, Level and Money update ---
|
# --- Experience, Level and Money update ---
|
||||||
func _on_xp_changed(xp) -> void:
|
func _on_xp_changed(xp) -> void:
|
||||||
var target_xp = PlayerData.xp_required_for_level(PlayerData.level)
|
%Experience.value = xp
|
||||||
var required_xp_to_value = (float(PlayerData.xp) / target_xp) * 100
|
|
||||||
%Experience.value = required_xp_to_value
|
|
||||||
|
|
||||||
func _on_level_changed(level) -> void:
|
func _on_level_changed(level) -> void:
|
||||||
%Level.text = 'Level: %d' % level
|
%Level.text = 'Level: %d' % level
|
||||||
|
|
||||||
func _on_money_changed(money) -> void:
|
func _on_money_changed(money) -> void:
|
||||||
%Money.text = 'Money: %.2f €' % money
|
%Money.text = 'Money: %.2f €' % money
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,6 @@ bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qru7b"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qru7b"]
|
||||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
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]
|
[node name="UI" type="Control" unique_id=256887379]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
|
|
@ -216,6 +213,7 @@ theme_override_constants/separation = 8
|
||||||
|
|
||||||
[node name="ShopTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=23859514]
|
[node name="ShopTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=23859514]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_vqjbf")
|
theme_override_styles/panel = SubResource("StyleBoxFlat_vqjbf")
|
||||||
|
|
||||||
|
|
@ -245,7 +243,6 @@ text = "Filaments"
|
||||||
|
|
||||||
[node name="Printers" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1896524960]
|
[node name="Printers" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1896524960]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_qru7b")
|
theme_override_styles/panel = SubResource("StyleBoxFlat_qru7b")
|
||||||
|
|
@ -274,26 +271,6 @@ theme_override_constants/separation = 8
|
||||||
[node name="Filaments" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1891341317]
|
[node name="Filaments" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1891341317]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_mmlst")
|
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Filaments" unique_id=1087434821]
|
|
||||||
layout_mode = 2
|
|
||||||
horizontal_scroll_mode = 0
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/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="VBoxContainer/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="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=526907583]
|
[node name="MenuTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=526907583]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
@ -311,3 +288,5 @@ autostart = true
|
||||||
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"]
|
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"]
|
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"]
|
[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"]
|
||||||
|
[connection signal="printer_purchase_requested" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" to="." method="_on_printers_printer_purchase_requested"]
|
||||||
|
[connection signal="timeout" from="JobSpawner" to="." method="_on_job_spawner_timeout"]
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,21 @@
|
||||||
extends MarginContainer
|
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:
|
func _ready() -> void:
|
||||||
%JobsTab.visible = true
|
%JobsTab.visible = true
|
||||||
%ShopTab.visible = false
|
%ShopTab.visible = false
|
||||||
%MenuTab.visible = false
|
%MenuTab.visible = false
|
||||||
disable_buttons("jobs")
|
|
||||||
|
|
||||||
func _on_jobs_tab_button_pressed() -> void:
|
func _on_jobs_tab_button_pressed() -> void:
|
||||||
%JobsTab.visible = true
|
%JobsTab.visible = true
|
||||||
%ShopTab.visible = false
|
%ShopTab.visible = false
|
||||||
%MenuTab.visible = false
|
%MenuTab.visible = false
|
||||||
disable_buttons("jobs")
|
|
||||||
|
|
||||||
func _on_shop_tab_button_pressed() -> void:
|
func _on_shop_tab_button_pressed() -> void:
|
||||||
%JobsTab.visible = false
|
%JobsTab.visible = false
|
||||||
%ShopTab.visible = true
|
%ShopTab.visible = true
|
||||||
%MenuTab.visible = false
|
%MenuTab.visible = false
|
||||||
disable_buttons("shop")
|
|
||||||
|
|
||||||
func _on_menu_tab_button_pressed() -> void:
|
func _on_menu_tab_button_pressed() -> void:
|
||||||
%JobsTab.visible = false
|
%JobsTab.visible = false
|
||||||
%ShopTab.visible = false
|
%ShopTab.visible = false
|
||||||
%MenuTab.visible = true
|
%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
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue