Adds missing data
This commit is contained in:
parent
e6391d9fdd
commit
53cdcc3433
620 changed files with 47293 additions and 151 deletions
|
|
@ -0,0 +1,82 @@
|
|||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023 Mark McKay
|
||||
# https://github.com/blackears/cyclopsLevelBuilder
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
@tool
|
||||
extends Window
|
||||
class_name ImporterCyclopsFileWizard
|
||||
|
||||
#var _text_path:LineEdit
|
||||
var default_material:Material = preload("res://addons/cyclops_level_builder/materials/grid.tres")
|
||||
|
||||
var file_dialog:FileDialog
|
||||
var file_path:String
|
||||
|
||||
var plugin:CyclopsLevelBuilder
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
file_dialog = FileDialog.new()
|
||||
add_child(file_dialog)
|
||||
file_dialog.size = Vector2(600, 400)
|
||||
file_dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
|
||||
file_dialog.set_access(FileDialog.ACCESS_RESOURCES)
|
||||
file_dialog.title = "Import scene..."
|
||||
file_dialog.filters = PackedStringArray(["*.cyclops; Cyclops files"])
|
||||
file_dialog.current_file = file_path
|
||||
file_dialog.file_selected.connect(on_open_file)
|
||||
|
||||
%lineEdit_path.text = file_path
|
||||
|
||||
func on_open_file(path:String):
|
||||
file_path = path
|
||||
%lineEdit_path.text = path
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
|
||||
func _on_bn_browse_pressed():
|
||||
file_dialog.popup_centered()
|
||||
|
||||
|
||||
func _on_close_requested():
|
||||
hide()
|
||||
|
||||
|
||||
func _on_bn_cancel_pressed():
|
||||
hide()
|
||||
|
||||
func _on_bn_okay_pressed():
|
||||
var editor_scene_root:Node = plugin.get_editor_interface().get_edited_scene_root()
|
||||
|
||||
var cmd:CommandImportCyclopsFile = CommandImportCyclopsFile.new()
|
||||
cmd.builder = plugin
|
||||
cmd.file_path = file_path
|
||||
cmd.target_parent = editor_scene_root.get_path()
|
||||
|
||||
var undo:EditorUndoRedoManager = plugin.get_undo_redo()
|
||||
cmd.add_to_undo_manager(undo)
|
||||
|
||||
|
||||
hide()
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bl2ohfqvxwjke"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/cyclops_level_builder/io/importer/importer_cyclops_file_wizard.gd" id="1_sehb5"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_jvbwn"]
|
||||
MarginContainer/constants/margin_bottom = 10
|
||||
MarginContainer/constants/margin_left = 10
|
||||
MarginContainer/constants/margin_right = 10
|
||||
MarginContainer/constants/margin_top = 10
|
||||
|
||||
[node name="ImporterCyclopsFileWizard" type="Window"]
|
||||
size = Vector2i(600, 100)
|
||||
script = ExtResource("1_sehb5")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = SubResource("Theme_jvbwn")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Path
|
||||
"
|
||||
|
||||
[node name="lineEdit_path" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="bn_browse" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Browse"
|
||||
text = "..."
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="bn_okay" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Okay"
|
||||
|
||||
[node name="bn_cancel" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Cancel"
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="_on_close_requested"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/bn_browse" to="." method="_on_bn_browse_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/bn_okay" to="." method="_on_bn_okay_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/bn_cancel" to="." method="_on_bn_cancel_pressed"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue