it runs posts my 1=11 but when done it does not destory the up.
private IEnumerator mainDisplaytimer(BasePlayer player)
{
var LoadSteps = new List<string>
{
"Txt 1",
"Txt 2",
"Txt 3",
"Txt 4",
"Txt 5",
"Txt 6",
"Txt 7",
"Txt 8",
"Txt 9",
"Txt 10",
"Txt 11"
};
CuiHelper.DestroyUi(player, mainName);
var elements = new CuiElementContainer();
msg = "";
mainName = elements.Add(new CuiPanel
{
Image =
{
Color = "0.1 0.1 0.1 0"
},
RectTransform =
{
AnchorMin = "0 0",
AnchorMax = "1 1"
},
}, "Overlay", "ATM");
for (int i = 0; i < 11; i++)
{
elements.Add(new CuiLabel
{
Text =
{
Text = LoadSteps.ElementAt(i),
Font = "robotocondensed-regular.ttf",
Color = "1 1 1 1",
FontSize = 18,
Align = TextAnchor.MiddleCenter
},
RectTransform =
{
AnchorMin = $"0.06 {1 - 0.07*i + 0.006}",
AnchorMax = $"0.75 {1 - 0.07*(i - 1)}"
}
}, mainName);
CuiHelper.AddUi(player, elements);
if (i < 10)
{
Puts("working 1=11");
}
if (i == 10)
{
Puts("working done");
}
float waitTime = (float) Oxide.Core.Random.Range(0, 100) / 100;
if (i == 10)
{
waitTime = 1f;
}
yield return new WaitForSeconds(waitTime);
}
timer.Once(1f, () =>
{
CuiHelper.DestroyUi(player, mainName);
});
}