mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 20:43:46 +00:00
Updated dialogic
This commit is contained in:
parent
1d11462073
commit
cbb82512ee
483 changed files with 5743 additions and 2177 deletions
|
|
@ -53,61 +53,45 @@ func _on_sidebar_toggled(sidebar_shown: bool) -> void:
|
|||
|
||||
|
||||
func update_theme_additions() -> void:
|
||||
add_theme_stylebox_override(
|
||||
"panel",
|
||||
(
|
||||
DCSS
|
||||
. inline(
|
||||
{
|
||||
"background": get_theme_color("base_color", "Editor"),
|
||||
"padding":
|
||||
[5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()],
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
var holder_panel := (
|
||||
DCSS
|
||||
. inline(
|
||||
{
|
||||
"border-radius": 5,
|
||||
#'border': 2,
|
||||
#'border-color': get_theme_color("base_color", "Editor"),
|
||||
"background": get_theme_color("dark_color_2", "Editor"),
|
||||
"padding":
|
||||
[5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()],
|
||||
}
|
||||
)
|
||||
)
|
||||
add_theme_stylebox_override("panel", DCSS.inline({
|
||||
"background": get_theme_color("base_color", "Editor"),
|
||||
"padding":
|
||||
[5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()],
|
||||
}))
|
||||
var holder_panel := (DCSS.inline({
|
||||
"border-radius": 5,
|
||||
"background": get_theme_color("dark_color_2", "Editor"),
|
||||
"padding":
|
||||
[5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()],
|
||||
}))
|
||||
|
||||
holder_panel.border_width_top = 0
|
||||
holder_panel.corner_radius_top_left = 0
|
||||
editors_manager.editors_holder.add_theme_stylebox_override("panel", holder_panel)
|
||||
|
||||
if theme == null:
|
||||
theme = Theme.new()
|
||||
theme.clear()
|
||||
var new_theme := Theme.new()
|
||||
|
||||
theme.set_type_variation("DialogicTitle", "Label")
|
||||
theme.set_font("font", "DialogicTitle", get_theme_font("title", "EditorFonts"))
|
||||
theme.set_color("font_color", "DialogicTitle", get_theme_color("warning_color", "Editor"))
|
||||
theme.set_color(
|
||||
new_theme.set_type_variation("DialogicTitle", "Label")
|
||||
new_theme.set_font("font", "DialogicTitle", get_theme_font("title", "EditorFonts"))
|
||||
new_theme.set_color("font_color", "DialogicTitle", get_theme_color("warning_color", "Editor"))
|
||||
new_theme.set_color(
|
||||
"font_uneditable_color", "DialogicTitle", get_theme_color("warning_color", "Editor")
|
||||
)
|
||||
theme.set_color(
|
||||
new_theme.set_color(
|
||||
"font_selected_color", "DialogicTitle", get_theme_color("warning_color", "Editor")
|
||||
)
|
||||
theme.set_font_size(
|
||||
new_theme.set_font_size(
|
||||
"font_size", "DialogicTitle", get_theme_font_size("doc_size", "EditorFonts")
|
||||
)
|
||||
|
||||
theme.set_type_variation("DialogicSubTitle", "Label")
|
||||
theme.set_font("font", "DialogicSubTitle", get_theme_font("title", "EditorFonts"))
|
||||
theme.set_font_size(
|
||||
new_theme.set_type_variation("DialogicSubTitle", "Label")
|
||||
new_theme.set_font("font", "DialogicSubTitle", get_theme_font("title", "EditorFonts"))
|
||||
new_theme.set_font_size(
|
||||
"font_size", "DialogicSubTitle", get_theme_font_size("doc_size", "EditorFonts")
|
||||
)
|
||||
theme.set_color("font_color", "DialogicSubTitle", get_theme_color("accent_color", "Editor"))
|
||||
new_theme.set_color("font_color", "DialogicSubTitle", get_theme_color("accent_color", "Editor"))
|
||||
|
||||
theme.set_type_variation("DialogicPanelA", "PanelContainer")
|
||||
new_theme.set_type_variation("DialogicPanelA", "PanelContainer")
|
||||
var panel_style := (
|
||||
DCSS
|
||||
. inline(
|
||||
|
|
@ -118,19 +102,19 @@ func update_theme_additions() -> void:
|
|||
}
|
||||
)
|
||||
)
|
||||
theme.set_stylebox("panel", "DialogicPanelA", panel_style)
|
||||
theme.set_stylebox("normal", "DialogicPanelA", panel_style)
|
||||
new_theme.set_stylebox("panel", "DialogicPanelA", panel_style)
|
||||
new_theme.set_stylebox("normal", "DialogicPanelA", panel_style)
|
||||
|
||||
var dark_panel := panel_style.duplicate()
|
||||
dark_panel.bg_color = get_theme_color("dark_color_3", "Editor")
|
||||
theme.set_stylebox("panel", "DialogicPanelDarkA", dark_panel)
|
||||
new_theme.set_stylebox("panel", "DialogicPanelDarkA", dark_panel)
|
||||
|
||||
var cornerless_panel := panel_style.duplicate()
|
||||
cornerless_panel.corner_radius_top_left = 0
|
||||
theme.set_stylebox("panel", "DialogicPanelA_cornerless", cornerless_panel)
|
||||
new_theme.set_stylebox("panel", "DialogicPanelA_cornerless", cornerless_panel)
|
||||
|
||||
# panel used for example for portrait previews in character editor
|
||||
theme.set_type_variation("DialogicPanelB", "PanelContainer")
|
||||
new_theme.set_type_variation("DialogicPanelB", "PanelContainer")
|
||||
var side_panel: StyleBoxFlat = panel_style.duplicate()
|
||||
side_panel.corner_radius_top_left = 0
|
||||
side_panel.corner_radius_bottom_left = 0
|
||||
|
|
@ -138,10 +122,11 @@ func update_theme_additions() -> void:
|
|||
side_panel.bg_color = get_theme_color("dark_color_2", "Editor")
|
||||
side_panel.set_border_width_all(1)
|
||||
side_panel.border_width_left = 0
|
||||
side_panel.content_margin_left = 0
|
||||
side_panel.border_color = get_theme_color("contrast_color_2", "Editor")
|
||||
theme.set_stylebox("panel", "DialogicPanelB", side_panel)
|
||||
new_theme.set_stylebox("panel", "DialogicPanelB", side_panel)
|
||||
|
||||
theme.set_type_variation("DialogicEventEdit", "Control")
|
||||
new_theme.set_type_variation("DialogicEventEdit", "Control")
|
||||
var edit_panel := StyleBoxFlat.new()
|
||||
edit_panel.draw_center = true
|
||||
edit_panel.bg_color = get_theme_color("accent_color", "Editor")
|
||||
|
|
@ -153,96 +138,81 @@ func update_theme_additions() -> void:
|
|||
edit_panel.content_margin_left = 5
|
||||
edit_panel.content_margin_right = 5
|
||||
edit_panel.set_corner_radius_all(1)
|
||||
theme.set_stylebox("panel", "DialogicEventEdit", edit_panel)
|
||||
theme.set_stylebox("normal", "DialogicEventEdit", edit_panel)
|
||||
new_theme.set_stylebox("panel", "DialogicEventEdit", edit_panel)
|
||||
new_theme.set_stylebox("normal", "DialogicEventEdit", edit_panel)
|
||||
|
||||
var focus_edit := edit_panel.duplicate()
|
||||
focus_edit.border_color = get_theme_color("property_color_z", "Editor")
|
||||
focus_edit.draw_center = false
|
||||
theme.set_stylebox("focus", "DialogicEventEdit", focus_edit)
|
||||
new_theme.set_stylebox("focus", "DialogicEventEdit", focus_edit)
|
||||
|
||||
var hover_edit := edit_panel.duplicate()
|
||||
hover_edit.border_color = get_theme_color("warning_color", "Editor")
|
||||
|
||||
theme.set_stylebox("hover", "DialogicEventEdit", hover_edit)
|
||||
new_theme.set_stylebox("hover", "DialogicEventEdit", hover_edit)
|
||||
var disabled_edit := edit_panel.duplicate()
|
||||
disabled_edit.border_color = get_theme_color("property_color", "Editor")
|
||||
theme.set_stylebox("disabled", "DialogicEventEdit", disabled_edit)
|
||||
new_theme.set_stylebox("disabled", "DialogicEventEdit", disabled_edit)
|
||||
|
||||
theme.set_type_variation("DialogicHintText", "Label")
|
||||
theme.set_color("font_color", "DialogicHintText", get_theme_color("readonly_color", "Editor"))
|
||||
theme.set_font("font", "DialogicHintText", get_theme_font("doc_italic", "EditorFonts"))
|
||||
new_theme.set_type_variation("DialogicHintText", "Label")
|
||||
new_theme.set_color("font_color", "DialogicHintText", get_theme_color("readonly_color", "Editor"))
|
||||
new_theme.set_font("font", "DialogicHintText", get_theme_font("doc_italic", "EditorFonts"))
|
||||
|
||||
theme.set_type_variation("DialogicHintText2", "Label")
|
||||
theme.set_color(
|
||||
new_theme.set_type_variation("DialogicHintText2", "Label")
|
||||
new_theme.set_color(
|
||||
"font_color", "DialogicHintText2", get_theme_color("property_color_w", "Editor")
|
||||
)
|
||||
theme.set_font("font", "DialogicHintText2", get_theme_font("doc_italic", "EditorFonts"))
|
||||
new_theme.set_font("font", "DialogicHintText2", get_theme_font("doc_italic", "EditorFonts"))
|
||||
|
||||
theme.set_type_variation("DialogicSection", "Label")
|
||||
theme.set_font("font", "DialogicSection", get_theme_font("main_msdf", "EditorFonts"))
|
||||
theme.set_color("font_color", "DialogicSection", get_theme_color("property_color_z", "Editor"))
|
||||
theme.set_font_size(
|
||||
new_theme.set_type_variation("DialogicSection", "Label")
|
||||
new_theme.set_font("font", "DialogicSection", get_theme_font("main_msdf", "EditorFonts"))
|
||||
new_theme.set_color("font_color", "DialogicSection", get_theme_color("property_color_z", "Editor"))
|
||||
new_theme.set_font_size(
|
||||
"font_size", "DialogicSection", get_theme_font_size("doc_size", "EditorFonts")
|
||||
)
|
||||
|
||||
theme.set_type_variation("DialogicSettingsSection", "DialogicSection")
|
||||
theme.set_font("font", "DialogicSettingsSection", get_theme_font("main_msdf", "EditorFonts"))
|
||||
theme.set_color(
|
||||
new_theme.set_type_variation("DialogicSettingsSection", "DialogicSection")
|
||||
new_theme.set_font("font", "DialogicSettingsSection", get_theme_font("main_msdf", "EditorFonts"))
|
||||
new_theme.set_color(
|
||||
"font_color", "DialogicSettingsSection", get_theme_color("property_color_z", "Editor")
|
||||
)
|
||||
theme.set_font_size(
|
||||
new_theme.set_font_size(
|
||||
"font_size", "DialogicSettingsSection", get_theme_font_size("doc_size", "EditorFonts")
|
||||
)
|
||||
|
||||
theme.set_type_variation("DialogicSectionBig", "DialogicSection")
|
||||
theme.set_color("font_color", "DialogicSectionBig", get_theme_color("accent_color", "Editor"))
|
||||
theme.set_font_size(
|
||||
new_theme.set_type_variation("DialogicSectionBig", "DialogicSection")
|
||||
new_theme.set_color("font_color", "DialogicSectionBig", get_theme_color("accent_color", "Editor"))
|
||||
new_theme.set_font_size(
|
||||
"font_size", "DialogicSectionBig", get_theme_font_size("doc_title_size", "EditorFonts")
|
||||
)
|
||||
|
||||
theme.set_type_variation("DialogicLink", "LinkButton")
|
||||
theme.set_color("font_hover_color", "DialogicLink", get_theme_color("warning_color", "Editor"))
|
||||
new_theme.set_type_variation("DialogicLink", "LinkButton")
|
||||
new_theme.set_color("font_hover_color", "DialogicLink", get_theme_color("warning_color", "Editor"))
|
||||
|
||||
theme.set_type_variation("DialogicMegaSeparator", "HSeparator")
|
||||
(
|
||||
theme
|
||||
. set_stylebox(
|
||||
"separator",
|
||||
"DialogicMegaSeparator",
|
||||
(
|
||||
DCSS
|
||||
. inline(
|
||||
{
|
||||
new_theme.set_type_variation("DialogicMegaSeparator", "HSeparator")
|
||||
new_theme.set_stylebox("separator", "DialogicMegaSeparator",
|
||||
DCSS.inline({
|
||||
"border-radius": 10,
|
||||
"border": 0,
|
||||
"background": get_theme_color("accent_color", "Editor"),
|
||||
"padding": [5, 5],
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
theme.set_constant("separation", "DialogicMegaSeparator", 50)
|
||||
new_theme.set_constant("separation", "DialogicMegaSeparator", 50)
|
||||
|
||||
theme.set_type_variation("DialogicTextEventTextEdit", "CodeEdit")
|
||||
new_theme.set_type_variation("DialogicTextEventTextEdit", "CodeEdit")
|
||||
var editor_settings := plugin_reference.get_editor_interface().get_editor_settings()
|
||||
var text_panel := (
|
||||
DCSS
|
||||
. inline(
|
||||
{
|
||||
var text_panel := DCSS.inline({
|
||||
"border-radius": 8,
|
||||
"background":
|
||||
editor_settings.get_setting("text_editor/theme/highlighting/background_color").lerp(
|
||||
editor_settings.get_setting("text_editor/theme/highlighting/text_color"), 0.05
|
||||
),
|
||||
"padding": [8, 8],
|
||||
}
|
||||
)
|
||||
)
|
||||
})
|
||||
text_panel.content_margin_bottom = 5
|
||||
text_panel.content_margin_left = 13
|
||||
theme.set_stylebox("normal", "DialogicTextEventTextEdit", text_panel)
|
||||
new_theme.set_stylebox("normal", "DialogicTextEventTextEdit", text_panel)
|
||||
|
||||
var event_field_group_panel := DCSS.inline({
|
||||
'border-radius': 8,
|
||||
|
|
@ -250,10 +220,12 @@ func update_theme_additions() -> void:
|
|||
"padding":2,
|
||||
"boder-color": get_theme_color("property_color", "Editor"),
|
||||
"background":"none"})
|
||||
theme.set_type_variation("DialogicEventEditGroup", "PanelContainer")
|
||||
theme.set_stylebox("panel", "DialogicEventEditGroup", event_field_group_panel)
|
||||
new_theme.set_type_variation("DialogicEventEditGroup", "PanelContainer")
|
||||
new_theme.set_stylebox("panel", "DialogicEventEditGroup", event_field_group_panel)
|
||||
|
||||
theme.set_icon('Plugin', 'Dialogic', load("res://addons/dialogic/Editor/Images/plugin-icon.svg"))
|
||||
new_theme.set_icon('Plugin', 'Dialogic', load("res://addons/dialogic/Editor/Images/plugin-icon.svg"))
|
||||
|
||||
theme = new_theme
|
||||
|
||||
|
||||
## Switches from floating window mode to embedded mode based on current mode
|
||||
|
|
@ -301,21 +273,28 @@ func swap_to_embedded_editor() -> void:
|
|||
|
||||
|
||||
func godot_file_dialog(
|
||||
callable: Callable,
|
||||
filter: String,
|
||||
mode := EditorFileDialog.FILE_MODE_OPEN_FILE,
|
||||
window_title := "Save",
|
||||
current_file_name := "New_File",
|
||||
saving_something := false,
|
||||
extra_message: String = ""
|
||||
) -> EditorFileDialog:
|
||||
callable: Callable, filter: String, mode := EditorFileDialog.FILE_MODE_OPEN_FILE,
|
||||
window_title := "Save",
|
||||
current_file_name := "New_File",
|
||||
saving_something := false,
|
||||
extra_message: String = ""
|
||||
) -> EditorFileDialog:
|
||||
|
||||
for connection in editor_file_dialog.file_selected.get_connections():
|
||||
editor_file_dialog.file_selected.disconnect(connection.callable)
|
||||
for connection in editor_file_dialog.dir_selected.get_connections():
|
||||
editor_file_dialog.dir_selected.disconnect(connection.callable)
|
||||
|
||||
if mode == EditorFileDialog.FILE_MODE_OPEN_FILE or mode == EditorFileDialog.FILE_MODE_SAVE_FILE:
|
||||
editor_file_dialog.file_selected.connect(callable)
|
||||
elif mode == EditorFileDialog.FILE_MODE_OPEN_DIR:
|
||||
editor_file_dialog.dir_selected.connect(callable)
|
||||
elif mode == EditorFileDialog.FILE_MODE_OPEN_ANY:
|
||||
editor_file_dialog.dir_selected.connect(callable)
|
||||
editor_file_dialog.file_selected.connect(callable)
|
||||
|
||||
editor_file_dialog.file_mode = mode
|
||||
editor_file_dialog.clear_filters()
|
||||
editor_file_dialog.popup_centered_ratio(0.6)
|
||||
editor_file_dialog.add_filter(filter)
|
||||
editor_file_dialog.title = window_title
|
||||
editor_file_dialog.current_file = current_file_name
|
||||
|
|
@ -325,12 +304,7 @@ func godot_file_dialog(
|
|||
editor_file_dialog.get_meta("info_message_label").text = extra_message
|
||||
else:
|
||||
editor_file_dialog.get_meta("info_message_label").hide()
|
||||
editor_file_dialog.popup_centered_ratio(0.6)
|
||||
|
||||
|
||||
if mode == EditorFileDialog.FILE_MODE_OPEN_FILE or mode == EditorFileDialog.FILE_MODE_SAVE_FILE:
|
||||
editor_file_dialog.file_selected.connect(callable)
|
||||
elif mode == EditorFileDialog.FILE_MODE_OPEN_DIR:
|
||||
editor_file_dialog.dir_selected.connect(callable)
|
||||
elif mode == EditorFileDialog.FILE_MODE_OPEN_ANY:
|
||||
editor_file_dialog.dir_selected.connect(callable)
|
||||
editor_file_dialog.file_selected.connect(callable)
|
||||
return editor_file_dialog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue