Рефактор. Уменьшить количество файлов
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dwphmxstaxn4v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjw0gwcqxx30d" path="res://table/lable.gd" id="1_xk0u2"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yign5"]
|
||||
bg_color = Color(0.117647, 0.117647, 0.117647, 0.85098)
|
||||
border_width_bottom = 2
|
||||
@@ -11,9 +9,36 @@ corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_dhnrx"]
|
||||
script/source = "extends Label
|
||||
|
||||
static var styles: = [null, null]
|
||||
static var init_done: = false
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
if init_done:
|
||||
init_done = true
|
||||
var style_light: = get_theme_stylebox('normal')
|
||||
style_light.bg_color = Color.GRAY
|
||||
styles[1] = style_light
|
||||
var style_dark: = style_light.duplicate(true)
|
||||
style_dark.bg_color = Color(0.12, 0.12, 0.12)
|
||||
styles[0] = style_dark
|
||||
ProjectSettings.connect('settings_changed', apply_colors)
|
||||
apply_colors()
|
||||
|
||||
|
||||
func apply_colors():
|
||||
if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false):
|
||||
add_theme_stylebox_override('normal', styles[1])
|
||||
else:
|
||||
add_theme_stylebox_override('normal', styles[0])
|
||||
"
|
||||
|
||||
[node name="Lable" type="Label"]
|
||||
offset_right = 104.0
|
||||
offset_bottom = 27.0
|
||||
theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1)
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_yign5")
|
||||
script = ExtResource("1_xk0u2")
|
||||
script = SubResource("GDScript_dhnrx")
|
||||
|
||||
Reference in New Issue
Block a user