Uploaded game files
This commit is contained in:
parent
459da513f6
commit
f71e7e39a0
1543 changed files with 50503 additions and 0 deletions
|
@ -0,0 +1,51 @@
|
|||
tool
|
||||
extends HBoxContainer
|
||||
|
||||
onready var visible_toggle = $VisibleToggle
|
||||
onready var preview = $MarginContainer/Preview
|
||||
|
||||
var enabled : bool
|
||||
var expanded: bool
|
||||
|
||||
var max_preview_characters = 50
|
||||
|
||||
signal state_changed(expanded)
|
||||
|
||||
func _ready():
|
||||
$MarginContainer/Preview.set("custom_colors/font_color", get_color("disabled_font_color", "Editor"))
|
||||
set_enabled(false)
|
||||
visible_toggle.connect("toggled", self, "_on_VisibleToggle_toggled")
|
||||
|
||||
|
||||
func set_preview(text: String):
|
||||
if len(text) > 50:
|
||||
text = text.substr(0, 50)
|
||||
text += "..."
|
||||
preview.text = text
|
||||
|
||||
|
||||
func set_enabled(enabled: bool):
|
||||
self.enabled = enabled
|
||||
set_expanded(enabled)
|
||||
if enabled:
|
||||
show()
|
||||
else:
|
||||
hide()
|
||||
|
||||
|
||||
func set_expanded(expanded: bool):
|
||||
if not enabled:
|
||||
return
|
||||
self.expanded = expanded
|
||||
visible_toggle.pressed = expanded
|
||||
if expanded:
|
||||
preview.hide()
|
||||
else:
|
||||
preview.show()
|
||||
visible_toggle.release_focus()
|
||||
emit_signal("state_changed", expanded)
|
||||
|
||||
|
||||
func _on_VisibleToggle_toggled(button_pressed: bool):
|
||||
if enabled:
|
||||
set_expanded(button_pressed)
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/ExpandControl.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/VisibleToggle.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="ExpandControl" type="HBoxContainer"]
|
||||
visible = false
|
||||
margin_right = 62.0
|
||||
margin_bottom = 30.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VisibleToggle" parent="." instance=ExtResource( 4 )]
|
||||
margin_left = 8.0
|
||||
margin_right = 38.0
|
||||
pressed = false
|
||||
script = null
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
margin_left = 42.0
|
||||
margin_right = 64.0
|
||||
margin_bottom = 30.0
|
||||
mouse_filter = 1
|
||||
custom_constants/margin_left = 10
|
||||
|
||||
[node name="Preview" type="Label" parent="MarginContainer"]
|
||||
margin_left = 10.0
|
||||
margin_top = 8.0
|
||||
margin_right = 22.0
|
||||
margin_bottom = 22.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "..."
|
|
@ -0,0 +1,17 @@
|
|||
tool
|
||||
extends PopupMenu
|
||||
|
||||
func _ready():
|
||||
clear()
|
||||
add_icon_item(get_icon("Help", "EditorIcons"), "Documentation")
|
||||
add_separator()
|
||||
add_icon_item(get_icon("ArrowUp", "EditorIcons"), "Move up")
|
||||
add_icon_item(get_icon("ArrowDown", "EditorIcons"), "Move down")
|
||||
add_separator()
|
||||
add_icon_item(get_icon("Remove", "EditorIcons"), "Delete")
|
||||
|
||||
var menu_background = load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")
|
||||
menu_background.bg_color = get_color("base_color", "Editor")
|
||||
add_stylebox_override('panel', menu_background)
|
||||
add_stylebox_override('hover', StyleBoxEmpty.new())
|
||||
add_color_override('font_color_hover', get_color("accent_color", "Editor"))
|
|
@ -0,0 +1,49 @@
|
|||
tool
|
||||
extends CheckBox
|
||||
|
||||
var current_piece
|
||||
var is_disabled = false
|
||||
|
||||
|
||||
func _ready():
|
||||
# Gotta love the nodes system some times
|
||||
# Praise the paths (っ´ω`c)♡
|
||||
current_piece = get_parent().get_parent().get_parent().get_parent()
|
||||
connect("toggled", self, "_on_VisibleToggle_toggled")
|
||||
|
||||
|
||||
func disabled():
|
||||
self_modulate = Color(0,0,0,0)
|
||||
is_disabled = true
|
||||
|
||||
|
||||
func set_visible(visible: bool):
|
||||
pressed = visible
|
||||
var current_rect_size = current_piece.get("rect_size")
|
||||
if visible:
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").hide()
|
||||
|
||||
var index = 0
|
||||
for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
|
||||
if index > 0:
|
||||
node.show()
|
||||
index += 1
|
||||
else:
|
||||
if current_piece.has_node("PanelContainer/VBoxContainer/Header/Preview"):
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").show()
|
||||
|
||||
var index = 0
|
||||
for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
|
||||
if index > 0:
|
||||
node.hide()
|
||||
index += 1
|
||||
if "preview" in current_piece:
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").text = current_piece.preview
|
||||
current_piece.set("rect_size", Vector2(current_rect_size.x,0))
|
||||
release_focus()
|
||||
|
||||
|
||||
func _on_VisibleToggle_toggled(button_pressed):
|
||||
if is_disabled:
|
||||
return
|
||||
set_visible(button_pressed)
|
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Images/Pieces/open-icon.svg" type="Texture" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Images/Pieces/closed-icon.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/VisibleToggle.gd" type="Script" id=3]
|
||||
|
||||
[node name="VisibleToggle" type="CheckBox"]
|
||||
margin_right = 30.0
|
||||
margin_bottom = 30.0
|
||||
custom_icons/checked = ExtResource( 1 )
|
||||
custom_icons/unchecked = ExtResource( 2 )
|
||||
pressed = true
|
||||
flat = true
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue