signal verkabelun komplett in code via connect gelegt
This commit is contained in:
parent
0b000e0be8
commit
83b6f498e7
4 changed files with 42 additions and 22 deletions
|
|
@ -165,13 +165,14 @@ tile_set = SubResource("TileSet_y3acc")
|
|||
tile_set = SubResource("TileSet_fax2j")
|
||||
script = ExtResource("4_qib1m")
|
||||
|
||||
[node name="CursorTimer" type="Timer" parent="VBoxContainer/Map"]
|
||||
[node name="MapCursorTimer" type="Timer" parent="VBoxContainer/Map"]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("5_8wy1m")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Palette" type="PanelContainer" parent="UI"]
|
||||
[node name="PalettePanel" type="PanelContainer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
anchors_preset = 1
|
||||
|
|
@ -181,12 +182,12 @@ offset_left = -80.0
|
|||
offset_bottom = 640.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="UI/Palette"]
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="UI/PalettePanel"]
|
||||
layout_mode = 2
|
||||
follow_focus = true
|
||||
draw_focus_border = true
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI/Palette/ScrollContainer"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI/PalettePanel/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 4
|
||||
|
|
@ -194,7 +195,7 @@ theme_override_constants/margin_top = 2
|
|||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 2
|
||||
|
||||
[node name="PaletteContainer" type="VBoxContainer" parent="UI/Palette/ScrollContainer/MarginContainer"]
|
||||
[node name="PaletteContainer" type="VBoxContainer" parent="UI/PalettePanel/ScrollContainer/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(72, 72)
|
||||
|
|
@ -202,28 +203,30 @@ layout_mode = 2
|
|||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="UI/Palette/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
[node name="Label" type="Label" parent="UI/PalettePanel/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
layout_mode = 2
|
||||
text = "Palette"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="UI/Palette/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
[node name="TextureRect" type="TextureRect" parent="UI/PalettePanel/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
texture = SubResource("CompressedTexture2D_ioj5u")
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="UI/Palette/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
[node name="TextureRect2" type="TextureRect" parent="UI/PalettePanel/ScrollContainer/MarginContainer/PaletteContainer"]
|
||||
layout_mode = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
texture = SubResource("CompressedTexture2D_slrw0")
|
||||
|
||||
[node name="MenuTop" type="HBoxContainer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 227.0
|
||||
offset_bottom = 40.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="opt_map" type="OptionButton" parent="UI/MenuTop"]
|
||||
[node name="MapMenu" type="OptionButton" parent="UI/MenuTop"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
selected = 0
|
||||
item_count = 4
|
||||
|
|
@ -236,7 +239,8 @@ popup/item_2/id = 1
|
|||
popup/item_3/text = "...speichern als..."
|
||||
popup/item_3/id = 2
|
||||
|
||||
[node name="btn_palette" type="Button" parent="UI/MenuTop"]
|
||||
[node name="PaletteButton" type="Button" parent="UI/MenuTop"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Palette"
|
||||
script = ExtResource("2_fax2j")
|
||||
|
|
@ -258,13 +262,5 @@ script = ExtResource("8_4uh5x")
|
|||
script = ExtResource("8_y3acc")
|
||||
|
||||
[node name="GroundMapManager" type="Node" parent="Logic"]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("1_fax2j")
|
||||
|
||||
[connection signal="mouse_entered" from="UI/Palette" to="VBoxContainer/Map/CursorTimer" method="disable_cursor"]
|
||||
[connection signal="mouse_exited" from="UI/Palette" to="VBoxContainer/Map/CursorTimer" method="enable_cursor"]
|
||||
[connection signal="mouse_entered" from="UI/MenuTop" to="VBoxContainer/Map/CursorTimer" method="disable_cursor"]
|
||||
[connection signal="mouse_exited" from="UI/MenuTop" to="VBoxContainer/Map/CursorTimer" method="enable_cursor"]
|
||||
[connection signal="item_selected" from="UI/MenuTop/opt_map" to="Logic/GroundMapManager" method="_on_opt_map_item_selected"]
|
||||
[connection signal="mouse_entered" from="UI/MenuTop/opt_map" to="VBoxContainer/Map/CursorTimer" method="disable_cursor"]
|
||||
[connection signal="mouse_exited" from="UI/MenuTop/opt_map" to="VBoxContainer/Map/CursorTimer" method="enable_cursor"]
|
||||
[connection signal="selected_map_for_loading" from="Logic/Startup" to="Data/ResourceSaver" method="loadMap"]
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
extends Node
|
||||
|
||||
@onready var vbox_palette: VBoxContainer = %PaletteContainer
|
||||
@onready var map_layer = %GroundMapLayer
|
||||
@onready var ground_map = %GroundMapLayer
|
||||
|
||||
|
||||
var content = null
|
||||
var coord2tilename = {}
|
||||
var tilename2coord = {}
|
||||
|
||||
func _ready():
|
||||
load_csv()
|
||||
map_layer.hex_clicked.connect(_on_hex_clicked)
|
||||
|
||||
ground_map.hex_clicked.connect(_on_hex_clicked)
|
||||
|
||||
|
||||
|
||||
|
||||
print("Palette initialized.")
|
||||
|
||||
var atlas_texture = AtlasTexture.new()
|
||||
var atlas_image = Image.new()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ func _ready():
|
|||
pass
|
||||
|
||||
func saveMap():
|
||||
print("Triggered ResourceSaver.saveMap")
|
||||
var map_data = MapData.new()
|
||||
map_data.cells = %GroundMapLayer.get_used_cells()
|
||||
var map_file = Global.settings["current_project_dir"] + "/" + Global.settings["current_map_name"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,26 @@
|
|||
extends Node
|
||||
|
||||
@onready var ground_map:TileMapLayer = %GroundMapLayer
|
||||
@onready var map_menu:OptionButton = %MapMenu
|
||||
@onready var map_manager:Node = %GroundMapManager
|
||||
@onready var palette_panel:PanelContainer = %PalettePanel
|
||||
@onready var map_cursor_timer:Timer = %MapCursorTimer
|
||||
@onready var menu_top:HBoxContainer = %MenuTop
|
||||
|
||||
signal selected_map_for_loading(map_file_name:String)
|
||||
|
||||
func _ready():
|
||||
selected_map_for_loading.connect(%ResourceSaver.loadMap)
|
||||
|
||||
map_menu.item_selected.connect(map_manager._on_opt_map_item_selected)
|
||||
|
||||
palette_panel.mouse_entered.connect(map_cursor_timer.disable_cursor)
|
||||
palette_panel.mouse_exited.connect(map_cursor_timer.enable_cursor)
|
||||
menu_top.mouse_entered.connect(map_cursor_timer.disable_cursor)
|
||||
menu_top.mouse_exited.connect(map_cursor_timer.enable_cursor)
|
||||
map_menu.mouse_entered.connect(map_cursor_timer.disable_cursor)
|
||||
map_menu.mouse_exited.connect(map_cursor_timer.enable_cursor)
|
||||
|
||||
load_settings()
|
||||
|
||||
func load_settings():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue