71 lines
1.7 KiB
C#
71 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using Godot;
|
|
using Godot.Bridge;
|
|
using Godot.NativeInterop;
|
|
|
|
[ScriptPath("res://Scripts/Events/LegendCS.cs")]
|
|
public partial class LegendCS : Sprite2D
|
|
{
|
|
[Export(PropertyHint.None, "")]
|
|
private Sprite2D[] sprites;
|
|
|
|
public Coroutine routine;
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
sprites[1].Visible = false;
|
|
base.Modulate = Main.colorClear;
|
|
routine = Coroutine.Start(Routine());
|
|
}
|
|
|
|
private IEnumerator Routine()
|
|
{
|
|
CameraController.instance.cover.ZIndex = 1000;
|
|
float a = 0f;
|
|
for (float b = 200f; a < b; a += Main.deltaTime)
|
|
{
|
|
base.Modulate = Main.colorClear.Lerp(Main.colorWhite, (float)Mathf.FloorToInt(a / b * 10f) / 10f);
|
|
yield return null;
|
|
}
|
|
TextSystem.slow = true;
|
|
TextSystem.instance.SelfModulate = Main.colorClear;
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
TextSystem.GetText("LegendCS" + (i + 1));
|
|
while (TextSystem.instance.Visible)
|
|
{
|
|
yield return null;
|
|
}
|
|
sprites[1].Visible = true;
|
|
if (i < 4)
|
|
{
|
|
float b = 0f;
|
|
for (a = 100f; b <= a; b += Main.deltaTime)
|
|
{
|
|
sprites[0].SelfModulate = Main.colorWhite.Lerp(Main.colorClear, (float)Mathf.FloorToInt(b / a * 10f) / 10f);
|
|
yield return null;
|
|
}
|
|
sprites[0].Frame++;
|
|
if (sprites[1].Frame < 4)
|
|
{
|
|
sprites[1].Frame++;
|
|
}
|
|
sprites[0].SelfModulate = Main.colorWhite;
|
|
sprites[1].Visible = false;
|
|
}
|
|
}
|
|
a = 0f;
|
|
for (float b = 200f; a < b; a += Main.deltaTime)
|
|
{
|
|
base.Modulate = Main.colorWhite.Lerp(Main.colorClearB, (float)Mathf.FloorToInt(a / b * 10f) / 10f);
|
|
yield return null;
|
|
}
|
|
TextSystem.instance.SelfModulate = Main.colorWhite;
|
|
TextSystem.slow = false;
|
|
QueueFree();
|
|
}
|
|
|
|
}
|