removed workarounds for a bug no longer present since Godot 4.1.Stable
This commit is contained in:
parent
01eb4e494f
commit
9de8504b54
@ -40,8 +40,12 @@ size = Vector2(60.7945, 58.1036)
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_70vuu"]
|
||||
size = Vector2(350, 250)
|
||||
|
||||
[node name="Card" type="Node2D" node_paths=PackedStringArray("watch")]
|
||||
[node name="Card" type="Node2D" node_paths=PackedStringArray("pip_sprites", "icon_list", "time_button_sprites", "time_hovered_sprites", "watch")]
|
||||
script = ExtResource("1_bvmvn")
|
||||
pip_sprites = [NodePath("front/pip2"), NodePath("front/pip3"), NodePath("front/pip4"), NodePath("front/pip5"), NodePath("front/pip6"), NodePath("front/pip7"), NodePath("front/pip8"), NodePath("front/pip9")]
|
||||
icon_list = [NodePath("front/Bonus1"), NodePath("front/Bonus2"), NodePath("front/Bonus3"), NodePath("front/Bonus4")]
|
||||
time_button_sprites = [NodePath("watch/time1"), NodePath("watch/time2"), NodePath("watch/time3"), NodePath("watch/time4")]
|
||||
time_hovered_sprites = [NodePath("watch/time_hovered1"), NodePath("watch/time_hovered2"), NodePath("watch/time_hovered3"), NodePath("watch/time_hovered4")]
|
||||
watch = NodePath("watch")
|
||||
|
||||
[node name="front" type="TextureRect" parent="."]
|
||||
|
@ -45,8 +45,10 @@ region = Rect2(256, 0, 32, 32)
|
||||
atlas = SubResource("CompressedTexture2D_p5rfg")
|
||||
region = Rect2(288, 0, 32, 32)
|
||||
|
||||
[node name="Card Crafter" type="Node2D"]
|
||||
[node name="Card Crafter" type="Node2D" node_paths=PackedStringArray("symbol_buttons", "symbol_count_labels")]
|
||||
script = ExtResource("1_lgqnu")
|
||||
symbol_buttons = [NodePath("crossbutton"), NodePath("squarebutton"), NodePath("trianglebutton"), NodePath("crescentbutton"), NodePath("puppybutton"), NodePath("riverbutton"), NodePath("starbutton"), NodePath("chainbutton"), NodePath("gustbutton")]
|
||||
symbol_count_labels = [NodePath("crosscount"), NodePath("squarecount"), NodePath("trianglecount"), NodePath("crescentcount"), NodePath("puppycount"), NodePath("rivercount"), NodePath("starcount"), NodePath("chaincount"), NodePath("gustcount")]
|
||||
|
||||
[node name="main_camera" type="Camera2D" parent="."]
|
||||
zoom = Vector2(0.6, 0.6)
|
||||
|
@ -1,20 +1,17 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvxgkv7pwxh7"]
|
||||
|
||||
[ext_resource type="Script" path="res://PlayerBoard.gd" id="1_80bvu"]
|
||||
[ext_resource type="Script" path="res://Scripts/PlayerBoard.gd" id="1_dj0oi"]
|
||||
[ext_resource type="Texture2D" uid="uid://olxh7d7xkr5k" path="res://Assets/player_board.png" id="2_rx76r"]
|
||||
[ext_resource type="PackedScene" uid="uid://y2i3u6n1oowh" path="res://Scenes/deck.tscn" id="3_ypq4b"]
|
||||
[ext_resource type="PackedScene" uid="uid://baoec8cqmedf6" path="res://Scenes/worker_slot.tscn" id="4_o73ea"]
|
||||
|
||||
[node name="PlayerBoard" type="Node2D" node_paths=PackedStringArray("poor_deck", "good_deck", "great_deck", "shift_deck", "slot1", "slot2", "slot3", "slot4")]
|
||||
script = ExtResource("1_80bvu")
|
||||
[node name="PlayerBoard" type="Node2D" node_paths=PackedStringArray("poor_deck", "good_deck", "great_deck", "shift_deck", "slots")]
|
||||
script = ExtResource("1_dj0oi")
|
||||
poor_deck = NodePath("PoorDeck")
|
||||
good_deck = NodePath("GoodDeck")
|
||||
great_deck = NodePath("GreatDeck")
|
||||
shift_deck = NodePath("ShiftDeck")
|
||||
slot1 = NodePath("Slot1")
|
||||
slot2 = NodePath("Slot2")
|
||||
slot3 = NodePath("Slot3")
|
||||
slot4 = NodePath("Slot4")
|
||||
slots = [NodePath("Slot1"), NodePath("Slot2"), NodePath("Slot3"), NodePath("Slot4")]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_rx76r")
|
||||
|
@ -4,8 +4,10 @@
|
||||
[ext_resource type="Texture2D" uid="uid://d127pfpldgh1l" path="res://Assets/generatordesign.png" id="2_1kq1c"]
|
||||
[ext_resource type="PackedScene" uid="uid://b41yu27wmglap" path="res://Scenes/icon_button.tscn" id="3_421r6"]
|
||||
|
||||
[node name="Card Crafter" type="Node2D"]
|
||||
[node name="Card Crafter" type="Node2D" node_paths=PackedStringArray("symbol_buttons", "symbol_count_labels")]
|
||||
script = ExtResource("1_vn0ae")
|
||||
symbol_buttons = [NodePath("crossbutton"), NodePath("squarebutton"), NodePath("trianglebutton"), NodePath("crescentbutton"), NodePath("puppybutton"), NodePath("riverbutton"), NodePath("starbutton"), NodePath("chainbutton"), NodePath("gustbutton")]
|
||||
symbol_count_labels = [NodePath("crosscount"), NodePath("squarecount"), NodePath("trianglecount"), NodePath("crescentcount"), NodePath("puppycount"), NodePath("rivercount"), NodePath("starcount"), NodePath("chaincount"), NodePath("gustcount")]
|
||||
|
||||
[node name="main_camera" type="Camera2D" parent="."]
|
||||
zoom = Vector2(0.6, 0.6)
|
||||
|
@ -10,19 +10,6 @@ signal clients_discarded(cards: Array[NodePath])
|
||||
@export var great_deck: Deck
|
||||
@export var shift_deck: Deck
|
||||
@export var slots: Array[Workspace] = []
|
||||
#Workaround for bug in 4.0.3.stable
|
||||
@export var slot1: Workspace
|
||||
@export var slot2: Workspace
|
||||
@export var slot3: Workspace
|
||||
@export var slot4: Workspace
|
||||
|
||||
|
||||
func _ready():
|
||||
#Workaround for bug in 4.0.3.stable
|
||||
slots.append(slot1)
|
||||
slots.append(slot2)
|
||||
slots.append(slot3)
|
||||
slots.append(slot4)
|
||||
|
||||
|
||||
func add_to_roster(node_paths):
|
||||
@ -56,12 +43,6 @@ func process_decks() -> int:
|
||||
poor_deck.shuffle()
|
||||
good_deck.shuffle()
|
||||
great_deck.shuffle()
|
||||
#print("Cards in poor deck: " + str(poor_deck.cards.size()))
|
||||
#print("Cards discarded from poor deck: " + str(poor_deck.cards.size() - 1))
|
||||
#print("Cards in good deck: " + str(good_deck.cards.size()))
|
||||
#print("Cards discarded from good deck: " + str(ceil(good_deck.cards.size() / 2.0)))
|
||||
#print("Cards in great deck: " + str(great_deck.cards.size()))
|
||||
#print("Cards discarded from great deck: " + str(min(great_deck.cards.size(), 1)))
|
||||
for card in poor_deck.draw_cards(poor_deck.cards.size() - 1):
|
||||
discards.append(card.get_path())
|
||||
for card in good_deck.draw_cards(ceil(good_deck.cards.size() / 2.0)):
|
@ -2,8 +2,9 @@ extends Node2D
|
||||
|
||||
var card_scene = preload("res://Scenes/worker_card.tscn")
|
||||
var icon_order = [0, 1, 3, 5, 7, 8, 6, 4, 2]
|
||||
var symbol_buttons : Array[TextureButton] = []
|
||||
var symbol_count_labels : Array[LineEdit] = []
|
||||
|
||||
@export var symbol_buttons : Array[TextureButton] = []
|
||||
@export var symbol_count_labels : Array[LineEdit] = []
|
||||
|
||||
var card_array = []
|
||||
var selected_card = 0
|
||||
@ -16,26 +17,6 @@ var WORKER_DECK_SAVE_PATH = "user://worker_deck.json"
|
||||
#"worker 2": [10, 1, 3, 4, 8]
|
||||
|
||||
func _ready():
|
||||
#workaround for node array export bug present in Godot 4.0.3.Stable
|
||||
symbol_buttons.append($"crossbutton")
|
||||
symbol_buttons.append($"squarebutton")
|
||||
symbol_buttons.append($"trianglebutton")
|
||||
symbol_buttons.append($"crescentbutton")
|
||||
symbol_buttons.append($"puppybutton")
|
||||
symbol_buttons.append($"riverbutton")
|
||||
symbol_buttons.append($"starbutton")
|
||||
symbol_buttons.append($"chainbutton")
|
||||
symbol_buttons.append($"gustbutton")
|
||||
symbol_count_labels.append($"crosscount")
|
||||
symbol_count_labels.append($"squarecount")
|
||||
symbol_count_labels.append($"trianglecount")
|
||||
symbol_count_labels.append($"crescentcount")
|
||||
symbol_count_labels.append($"puppycount")
|
||||
symbol_count_labels.append($"rivercount")
|
||||
symbol_count_labels.append($"starcount")
|
||||
symbol_count_labels.append($"chaincount")
|
||||
symbol_count_labels.append($"gustcount")
|
||||
|
||||
load_deck()
|
||||
|
||||
func new_deck():
|
||||
|
@ -11,40 +11,18 @@ var title = "New Task"
|
||||
var initial_stress = 0
|
||||
var turns_left = 4
|
||||
var time_slots = [true, true, false, true]
|
||||
var icon_list = []
|
||||
var medium_threshold := 5
|
||||
var good_threshold := 8
|
||||
var satisfaction := 1
|
||||
var watch_on := false
|
||||
|
||||
@export var pip_sprites: Array[TextureRect] = []
|
||||
@export var icon_list: Array[Node2D] = []
|
||||
@export var time_button_sprites: Array[TextureRect] = []
|
||||
@export var time_hovered_sprites: Array[TextureRect] = []
|
||||
@export var watch: TextureRect
|
||||
|
||||
|
||||
func _ready():
|
||||
pip_sprites.append($front/pip2)
|
||||
pip_sprites.append($front/pip3)
|
||||
pip_sprites.append($front/pip4)
|
||||
pip_sprites.append($front/pip5)
|
||||
pip_sprites.append($front/pip6)
|
||||
pip_sprites.append($front/pip7)
|
||||
pip_sprites.append($front/pip8)
|
||||
pip_sprites.append($front/pip9)
|
||||
icon_list.append($front/Bonus1)
|
||||
icon_list.append($front/Bonus2)
|
||||
icon_list.append($front/Bonus3)
|
||||
icon_list.append($front/Bonus4)
|
||||
time_button_sprites.append($watch/time1)
|
||||
time_button_sprites.append($watch/time2)
|
||||
time_button_sprites.append($watch/time3)
|
||||
time_button_sprites.append($watch/time4)
|
||||
time_hovered_sprites.append($watch/time_hovered1)
|
||||
time_hovered_sprites.append($watch/time_hovered2)
|
||||
time_hovered_sprites.append($watch/time_hovered3)
|
||||
time_hovered_sprites.append($watch/time_hovered4)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if sliding:
|
||||
slide(delta)
|
||||
|
@ -2,8 +2,9 @@ extends Node2D
|
||||
|
||||
var card_scene = preload("res://Scenes/client_card.tscn")
|
||||
var icon_order = [0, 1, 3, 5, 7, 8, 6, 4, 2]
|
||||
var symbol_buttons : Array[TextureButton] = []
|
||||
var symbol_count_labels : Array[LineEdit] = []
|
||||
|
||||
@export var symbol_buttons : Array[TextureButton] = []
|
||||
@export var symbol_count_labels : Array[LineEdit] = []
|
||||
|
||||
var card_array = []
|
||||
var selected_card = 0
|
||||
@ -12,27 +13,7 @@ var card_count = 1
|
||||
var CLIENT_DECK_SAVE_PATH = "user://client_deck.json"
|
||||
|
||||
func _ready():
|
||||
#workaround for node array export bug present in Godot 4.0.3.Stable
|
||||
symbol_buttons.append($"crossbutton")
|
||||
symbol_buttons.append($"squarebutton")
|
||||
symbol_buttons.append($"trianglebutton")
|
||||
symbol_buttons.append($"crescentbutton")
|
||||
symbol_buttons.append($"puppybutton")
|
||||
symbol_buttons.append($"riverbutton")
|
||||
symbol_buttons.append($"starbutton")
|
||||
symbol_buttons.append($"chainbutton")
|
||||
symbol_buttons.append($"gustbutton")
|
||||
symbol_count_labels.append($"crosscount")
|
||||
symbol_count_labels.append($"squarecount")
|
||||
symbol_count_labels.append($"trianglecount")
|
||||
symbol_count_labels.append($"crescentcount")
|
||||
symbol_count_labels.append($"puppycount")
|
||||
symbol_count_labels.append($"rivercount")
|
||||
symbol_count_labels.append($"starcount")
|
||||
symbol_count_labels.append($"chaincount")
|
||||
symbol_count_labels.append($"gustcount")
|
||||
$Control/Card.turn_front()
|
||||
|
||||
load_deck()
|
||||
|
||||
func new_deck():
|
||||
|
Loading…
x
Reference in New Issue
Block a user