Рефактор. Уменьшить количество файлов
This commit is contained in:
@@ -1,10 +1,51 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://5rw652cmnybi"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings-toggle.gd" id="1_8lkgc"]
|
||||
[ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="1_anyuq"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_il5wc"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_vuu0m"]
|
||||
script/source = "extends LineEdit
|
||||
|
||||
static var styles = [[null, null], [null, null]]
|
||||
static var init_done: = false
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
if not init_done:
|
||||
init_done = true
|
||||
var style_0_light = get_theme_stylebox('normal')
|
||||
var style_1_light = get_theme_stylebox('read_only')
|
||||
|
||||
style_0_light.bg_color = Color(0.12, 0.12, 0.12)
|
||||
style_1_light.bg_color = Color(0.12, 0.12, 0.12)
|
||||
styles[1][0] = style_0_light
|
||||
styles[1][1] = style_1_light
|
||||
|
||||
var style_0_dark = style_0_light.duplicate(true)
|
||||
var style_1_dark = style_1_light.duplicate(true)
|
||||
|
||||
style_0_light.bg_color = Color.GRAY
|
||||
style_1_light.bg_color = Color.GRAY
|
||||
styles[0][0] = style_0_dark
|
||||
styles[0][1] = style_1_dark
|
||||
ProjectSettings.connect('settings_changed', apply_colors)
|
||||
apply_colors()
|
||||
|
||||
|
||||
func apply_colors():
|
||||
if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false):
|
||||
add_theme_color_override('font_color', Color.BLACK)
|
||||
add_theme_color_override('font_uneditable_color', Color.BLACK)
|
||||
add_theme_stylebox_override('normal', styles[1][0])
|
||||
add_theme_stylebox_override('read_only', styles[1][1])
|
||||
else:
|
||||
add_theme_color_override('font_color', Color(1.0, 0.596, 0.4))
|
||||
add_theme_color_override('font_uneditable_color', Color(1.0, 0.596, 0.4))
|
||||
add_theme_stylebox_override('normal', styles[0][0])
|
||||
add_theme_stylebox_override('read_only', styles[0][1])
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8lkgc"]
|
||||
shader = ExtResource("1_anyuq")
|
||||
|
||||
@@ -22,7 +63,7 @@ shortcut_keys_enabled = false
|
||||
middle_mouse_paste_enabled = false
|
||||
selecting_enabled = false
|
||||
deselect_on_focus_loss_enabled = false
|
||||
script = ExtResource("1_8lkgc")
|
||||
script = SubResource("GDScript_vuu0m")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="."]
|
||||
material = SubResource("ShaderMaterial_8lkgc")
|
||||
|
||||
Reference in New Issue
Block a user