mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-23 16:00:54 +00:00
added the game
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
@tool
|
||||
extends Window
|
||||
|
||||
|
||||
signal dir_selected(dir_path)
|
||||
|
||||
@onready var directory_list: VBoxContainer = $"%DirectoryList"
|
||||
|
||||
|
||||
func generate_dir_buttons(dir_path: String) -> void:
|
||||
clear_directory_list()
|
||||
var dir_paths := _ModLoaderPath.get_dir_paths_in_dir(dir_path)
|
||||
|
||||
for path in dir_paths:
|
||||
var dir_name: String = path.split('/')[-1]
|
||||
|
||||
var dir_btn := Button.new()
|
||||
dir_btn.text = dir_name
|
||||
|
||||
directory_list.add_child(dir_btn)
|
||||
dir_btn.pressed.connect(_on_dir_btn_dir_selected.bind(path))
|
||||
|
||||
|
||||
func clear_directory_list() -> void:
|
||||
for child in directory_list.get_children():
|
||||
directory_list.remove_child(child)
|
||||
child.queue_free()
|
||||
|
||||
|
||||
func _on_dir_btn_dir_selected(path: String) -> void:
|
||||
dir_selected.emit(path)
|
||||
|
||||
|
||||
func _on_close_requested() -> void:
|
||||
hide()
|
@@ -0,0 +1 @@
|
||||
uid://dyxgsmyqpv8e2
|
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://du17jjwqtopix"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/mod_tool/interface/global/directory_selection/select_directory.gd" id="1"]
|
||||
|
||||
[node name="SelectDirectory" type="Window"]
|
||||
initial_position = 2
|
||||
size = Vector2i(400, 250)
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 25
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="DirectoryList" type="VBoxContainer" parent="MarginContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="_on_close_requested"]
|
Reference in New Issue
Block a user