diff --git a/data/main-font.tres b/data/main-font.tres index 92f7276..c54b9b0 100644 --- a/data/main-font.tres +++ b/data/main-font.tres @@ -11,6 +11,7 @@ cache/0/16/0/underline_thickness = 0.0 cache/0/16/0/scale = 1.0 cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) cache/0/16/0/kerning_overrides/14/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/50/0 = Vector2(0, 0) cache/0/14/0/ascent = 0.0 cache/0/14/0/descent = 0.0 cache/0/14/0/underline_position = 0.0 @@ -18,3 +19,12 @@ cache/0/14/0/underline_thickness = 0.0 cache/0/14/0/scale = 1.0 cache/0/14/0/kerning_overrides/16/0 = Vector2(0, 0) cache/0/14/0/kerning_overrides/14/0 = Vector2(0, 0) +cache/0/14/0/kerning_overrides/50/0 = Vector2(0, 0) +cache/0/50/0/ascent = 0.0 +cache/0/50/0/descent = 0.0 +cache/0/50/0/underline_position = 0.0 +cache/0/50/0/underline_thickness = 0.0 +cache/0/50/0/scale = 1.0 +cache/0/50/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/50/0/kerning_overrides/14/0 = Vector2(0, 0) +cache/0/50/0/kerning_overrides/50/0 = Vector2(0, 0) diff --git a/scenes/bip/bip.gd b/scenes/bip/bip.gd index da6b8e1..49fbbf8 100644 --- a/scenes/bip/bip.gd +++ b/scenes/bip/bip.gd @@ -23,3 +23,7 @@ func _on_bip_gui_input(event): if selected: signaller.emit_signal('rto_threat_unsel', name.to_int()) + +func update(): + $bip.material.set('shader_parameter/tick_update', float(Time.get_ticks_msec()/1000)) + diff --git a/scenes/bip/bip.tscn b/scenes/bip/bip.tscn index f1601e5..4e64bd1 100644 --- a/scenes/bip/bip.tscn +++ b/scenes/bip/bip.tscn @@ -8,7 +8,7 @@ shader = ExtResource("2_rt0la") shader_parameter/color = Color(0.972549, 0.12549, 0.411765, 1) shader_parameter/color_up = Color(1, 1, 1, 1) -shader_parameter/tick_update = 0 +shader_parameter/tick_update = 0.0 [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_w5pye"] diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index ad138c4..852bc9e 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -180,6 +180,7 @@ func map_threat_to_bip(th: threats.Threat, bip: Control): ## Обработчик сигнала обновления цели. func on_threat_update(th): var bip = get_node('%d' % th.id) + bip.update() map_threat_to_bip(th, bip) diff --git a/shaders/bip.gdshader b/shaders/bip.gdshader index db41b3f..177cef5 100644 --- a/shaders/bip.gdshader +++ b/shaders/bip.gdshader @@ -5,8 +5,8 @@ shader_type canvas_item; /* Закрашенная окружность */ uniform vec4 color: source_color = vec4(1, 1, 1, 1); uniform vec4 color_up: source_color = vec4(1, 1, 1, 1); /* Цвет вспышки при обновлении */ -uniform uint tick_update = 0; /* Время последнего обновления, мс */ -const float time_delta = 0.1; /* Время вспышки при обновлении, c */ +uniform float tick_update = 0; /* Время последнего обновления, мс */ +const float time_delta = 0.5; /* Время вспышки при обновлении, c */ const float ds = 0.01; /* Относительное расстояние на котором выполняется сглаживание краёв */ const vec2 center = vec2(0.125, 0.125); /* Центр должен быть в (0.5, 0.5), но это не так */ const float radius = 0.075 - ds * 2.0; /* Радиус должен быть 0.5, но это не так */ @@ -16,4 +16,9 @@ const float radius = 0.075 - ds * 2.0; /* Радиус долж void fragment() { COLOR = color * smooth_px(length(UV - center), radius, ds); + float time_now = TIME; + if ((time_now - tick_update) < time_delta) + { + COLOR = COLOR - vec4(0.0, 0.0, 0.0, (time_delta - (time_now - tick_update)) * 0.5); + } }