Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CreditsRollEvent.cs
Go to the documentation of this file.
3
5
6public class CreditsRollEvent
7{
8 private const int MAX_TIME_FOR_CREDITS_ROLL_IN_FRAMES = 28800;
9
10 private static int _creditsRollRemainingTime;
11
12 public static bool IsEventOngoing => _creditsRollRemainingTime > 0;
13
14 public static void TryStartingCreditsRoll()
15 {
17 if (SkyManager.Instance["CreditsRoll"] is CreditsRollSky creditsRollSky)
18 {
19 _creditsRollRemainingTime = creditsRollSky.AmountOfTimeNeededForFullPlay;
20 }
21 if (Main.netMode == 2)
22 {
23 NetMessage.SendData(140, -1, -1, null, 0, _creditsRollRemainingTime);
24 }
25 }
26
27 public static void SendCreditsRollRemainingTimeToPlayer(int playerIndex)
28 {
29 if (_creditsRollRemainingTime != 0 && Main.netMode == 2)
30 {
31 NetMessage.SendData(140, playerIndex, -1, null, 0, _creditsRollRemainingTime);
32 }
33 }
34
35 public static void UpdateTime()
36 {
38 }
39
40 public static void Reset()
41 {
43 }
44
45 public static void SetRemainingTimeDirect(int time)
46 {
47 _creditsRollRemainingTime = Utils.Clamp(time, 0, 28800);
48 }
49}
static void SendCreditsRollRemainingTimeToPlayer(int playerIndex)
static int netMode
Definition Main.cs:2095
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
Definition NetMessage.cs:88