6 [
Attribute(
"#AR-ValueUnit_Short_Plus", uiwidget: UIWidgets.LocaleEditBox)]
9 protected TextWidget m_wSessionDurationText;
14 protected void SetSessionDurationTime()
21 float elapsedMs = world.GetServerTimestamp().DiffMilliseconds(
null);
28 override void HandlerAttachedScripted(Widget w)
34 if (Replication.IsRunning())
35 Print(
"'SCR_SessionDurationUIComponent' could not find 'SCR_BaseGameMode' so will show replication time instead which is not synced with players", LogLevel.WARNING);
38 m_wSessionDurationText = TextWidget.Cast(w);
39 if (!m_wSessionDurationText)
41 Print(
"'SCR_SessionDurationUIComponent' needs to be attached to a 'TextWidget'!", LogLevel.ERROR);
45 SetSessionDurationTime();
48 GetGame().GetCallqueue().CallLater(SetSessionDurationTime, 1000,
true);
53 override void HandlerDeattached(Widget w)
55 if (!m_wSessionDurationText)
58 GetGame().GetCallqueue().Remove(SetSessionDurationTime);