match-3 grid generation
make game scene modular global debug mode
This commit is contained in:
@@ -17,8 +17,11 @@ func _exit_tree():
|
||||
search_timer.queue_free()
|
||||
|
||||
func _ready():
|
||||
visible = false
|
||||
DebugManager.debug_toggled.connect(_on_debug_toggled)
|
||||
|
||||
# Initialize with current debug state
|
||||
var current_debug_state = DebugManager.is_debug_enabled()
|
||||
visible = current_debug_state
|
||||
regenerate_button.pressed.connect(_on_regenerate_pressed)
|
||||
gem_types_spinbox.value_changed.connect(_on_gem_types_changed)
|
||||
grid_width_spinbox.value_changed.connect(_on_grid_width_changed)
|
||||
@@ -62,7 +65,7 @@ func _find_match3_scene():
|
||||
var current_scene = get_tree().current_scene
|
||||
if current_scene:
|
||||
# Try to find match3 by class name first
|
||||
match3_scene = _find_node_by_script(current_scene, "res://scenes/match3/match3.gd")
|
||||
match3_scene = _find_node_by_script(current_scene, "res://scenes/game/gameplays/match3_gameplay.gd")
|
||||
|
||||
# Fallback: search by common node names
|
||||
if not match3_scene:
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
extends Button
|
||||
|
||||
func _ready():
|
||||
text = "Debug: OFF"
|
||||
pressed.connect(_on_pressed)
|
||||
DebugManager.debug_toggled.connect(_on_debug_toggled)
|
||||
|
||||
# Initialize with current debug state
|
||||
var current_state = DebugManager.is_debug_enabled()
|
||||
text = "Debug: " + ("ON" if current_state else "OFF")
|
||||
|
||||
func _on_pressed():
|
||||
DebugManager.toggle_debug()
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://m8lf3eh3al5j"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://m8lf3eh3al5j"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b2c35v0f6rymd" path="res://scenes/ui/MainMenu.gd" id="1_b00nv"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/ui/DebugToggle.tscn" id="2_debug"]
|
||||
|
||||
[node name="MainMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -37,6 +38,9 @@ text = "Settings"
|
||||
layout_mode = 2
|
||||
text = "Exit"
|
||||
|
||||
[node name="DebugToggle" parent="." instance=ExtResource("2_debug")]
|
||||
layout_mode = 1
|
||||
|
||||
[connection signal="pressed" from="MenuContainer/NewGameButton" to="." method="_on_new_game_button_pressed"]
|
||||
[connection signal="pressed" from="MenuContainer/SettingsButton" to="." method="_on_settings_button_pressed"]
|
||||
[connection signal="pressed" from="MenuContainer/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://57obmcwyos2g"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://57obmcwyos2g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bv56qwni68qo" path="res://scenes/ui/SettingsMenu.gd" id="1_oqkcn"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/ui/DebugToggle.tscn" id="2_debug"]
|
||||
|
||||
[node name="SettingsMenu" type="Control" groups=["localizable"]]
|
||||
layout_mode = 3
|
||||
@@ -103,13 +104,18 @@ popup/item_4/id = 2
|
||||
[node name="BackButtonContainer" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
offset_left = 10.0
|
||||
offset_top = 10.0
|
||||
offset_right = 55.0
|
||||
offset_bottom = 41.0
|
||||
|
||||
[node name="BackButton" type="Button" parent="BackButtonContainer"]
|
||||
layout_mode = 0
|
||||
offset_right = 8.0
|
||||
offset_bottom = 8.0
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "back"
|
||||
|
||||
[node name="ResetSettingsContainer" type="Control" parent="."]
|
||||
@@ -136,6 +142,9 @@ offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
text = "Reset settings to default"
|
||||
|
||||
[node name="DebugToggle" parent="." instance=ExtResource("2_debug")]
|
||||
layout_mode = 1
|
||||
|
||||
[connection signal="value_changed" from="SettingsContainer/MasterVolumeContainer/MasterVolumeSlider" to="." method="_on_master_volume_changed"]
|
||||
[connection signal="value_changed" from="SettingsContainer/MusicVolumeContainer/MusicVolumeSlider" to="." method="_on_music_volume_changed"]
|
||||
[connection signal="value_changed" from="SettingsContainer/SFXVolumeContainer/SFXVolumeSlider" to="." method="_on_sfx_volume_changed"]
|
||||
|
||||
Reference in New Issue
Block a user