First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
|||
@tool
|
||||
extends HBoxContainer
|
||||
|
||||
@onready var check_box: CheckBox = $CheckBox
|
||||
@onready var description: RichTextLabel = $Description
|
||||
@onready var progress: TextureRect = $Progress
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
PopochiuEditorHelper.override_font(description, "normal_font", "output_source")
|
||||
PopochiuEditorHelper.override_font(description, "bold_font", "output_source_bold")
|
||||
PopochiuEditorHelper.override_font(description, "italics_font", "output_source_italic")
|
||||
progress.hide()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
func start() -> void:
|
||||
var idx := 1
|
||||
progress.visible = true
|
||||
while progress.visible:
|
||||
progress.texture = get_theme_icon("Progress%d" % idx, "EditorIcons")
|
||||
await PopochiuEditorHelper.secs_passed(0.1)
|
||||
|
||||
idx = wrapi(idx + 1, 1, 9)
|
||||
|
||||
|
||||
func stop() -> void:
|
||||
progress.visible = false
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://brruh2jvx85oe
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,44 @@
|
|||
@tool
|
||||
extends PanelContainer
|
||||
|
||||
const MIGRATION_STEP_SCENE = preload(
|
||||
"res://addons/popochiu/editor/popups/migrations_panel/migration_step.tscn"
|
||||
)
|
||||
const MigrationStep = preload(
|
||||
"res://addons/popochiu/editor/popups/migrations_panel/migration_step.gd"
|
||||
)
|
||||
|
||||
@onready var description: Label = %Description
|
||||
@onready var steps: VBoxContainer = %Steps
|
||||
|
||||
|
||||
#region Public #####################################################################################
|
||||
func set_steps(steps_texts: Array) -> void:
|
||||
for text: String in steps_texts:
|
||||
var step: MigrationStep = MIGRATION_STEP_SCENE.instantiate()
|
||||
steps.add_child(step)
|
||||
step.description.text = text
|
||||
|
||||
|
||||
func start_step(idx: int) -> void:
|
||||
(steps.get_child(idx) as MigrationStep).start()
|
||||
|
||||
|
||||
func update_steps(popochiu_migration: PopochiuMigration) -> void:
|
||||
for idx: int in popochiu_migration.completed:
|
||||
var step: MigrationStep = steps.get_child(idx)
|
||||
step.check_box.set_pressed_no_signal(true)
|
||||
step.stop()
|
||||
|
||||
for idx: int in popochiu_migration.ignored:
|
||||
var step: MigrationStep = steps.get_child(idx)
|
||||
step.check_box.set_pressed_no_signal(false)
|
||||
step.modulate.a = 0.5
|
||||
step.stop()
|
||||
|
||||
|
||||
func get_total_height() -> float:
|
||||
return description.size.y + steps.size.y
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://uwi5nm4r2p1k
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://c1ivmn6tasatp"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/popochiu/editor/popups/migrations_panel/migration_tab.gd" id="1_2mn16"]
|
||||
|
||||
[node name="MigrationTab" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_2mn16")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Description" type="Label" parent="VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "The migration Description"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="Steps" type="VBoxContainer" parent="VBoxContainer/MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
|
@ -0,0 +1,50 @@
|
|||
@tool
|
||||
extends Control
|
||||
|
||||
const MIGRATION_TAB_SCENE = preload(
|
||||
"res://addons/popochiu/editor/popups/migrations_panel/migration_tab.tscn"
|
||||
)
|
||||
const MigrationTab = preload(
|
||||
"res://addons/popochiu/editor/popups/migrations_panel/migration_tab.gd"
|
||||
)
|
||||
|
||||
@onready var tab_container: TabContainer = %TabContainer
|
||||
@onready var reload_label: Label = %ReloadLabel
|
||||
|
||||
|
||||
#region Godot ######################################################################################
|
||||
func _ready() -> void:
|
||||
reload_label.hide()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public #####################################################################################
|
||||
func add_migration(popochiu_migration: PopochiuMigration) -> void:
|
||||
var migration := MIGRATION_TAB_SCENE.instantiate()
|
||||
tab_container.add_child.call_deferred(migration)
|
||||
await migration.ready
|
||||
|
||||
migration.name = popochiu_migration.get_migration_name()
|
||||
migration.anchors_preset = Control.PRESET_FULL_RECT
|
||||
migration.description.text = popochiu_migration.DESCRIPTION
|
||||
migration.set_steps(popochiu_migration.STEPS)
|
||||
|
||||
|
||||
func start_step(popochiu_migration: PopochiuMigration, idx: int) -> void:
|
||||
var migration_tab: MigrationTab = tab_container.get_node(
|
||||
popochiu_migration.get_migration_name()
|
||||
)
|
||||
tab_container.current_tab = migration_tab.get_index()
|
||||
migration_tab.start_step(idx)
|
||||
|
||||
|
||||
func update_steps(popochiu_migration: PopochiuMigration) -> void:
|
||||
var migration_tab: MigrationTab = tab_container.get_node(
|
||||
popochiu_migration.get_migration_name()
|
||||
)
|
||||
tab_container.current_tab = migration_tab.get_index()
|
||||
migration_tab.update_steps(popochiu_migration)
|
||||
|
||||
|
||||
#endregion
|
|
@ -0,0 +1 @@
|
|||
uid://bonq4almsk3mc
|
|
@ -0,0 +1,36 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dws64ahd0a1s6"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/popochiu/editor/popups/migrations_panel/migrations_panel.gd" id="1_brkhu"]
|
||||
|
||||
[node name="MigrationsPanel" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_brkhu")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="PanelContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ReloadLabel" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(320, 0)
|
||||
layout_mode = 2
|
||||
text = "The engine will restart after clicking OK."
|
||||
autowrap_mode = 2
|
Loading…
Add table
Add a link
Reference in a new issue