3 protected static float MENU_FADEIN_TIME = 2.0;
4 protected static float LOGO_FADEIN_TIME = 1.0;
5 protected static float CREDIT_SCROLL_SPEED = 200.0;
7 protected float m_MenuFadeInIncrement;
8 protected float m_MenuFadeInLevel;
9 protected float m_MenuFadeInLevel2 = 1;
10 protected float m_LogoFadeInIncrement;
11 protected float m_LogoFadeInLevel;
12 protected float m_ScrollIncrement;
13 protected float m_ScrollLevel;
14 protected float m_ScrollMax;
15 protected float m_ScrollSize;
19 protected float m_CurrentTime = 0.0;
22 protected ImageWidget m_Logo;
23 protected ScrollWidget m_Scroller;
24 protected WrapSpacerWidget m_Content;
26 protected Widget m_InfoPanel;
33 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/credits/credits_menu.layout",
null );
34 m_Logo = ImageWidget.Cast( layoutRoot.FindAnyWidget(
"Logo" ) );
35 m_Scroller = ScrollWidget.Cast( layoutRoot.FindAnyWidget(
"CreditsPanel" ) );
36 m_Content = WrapSpacerWidget.Cast( layoutRoot.FindAnyWidget(
"CreditsContent" ) );
37 m_InfoPanelText =
RichTextWidget.Cast( layoutRoot.FindAnyWidget(
"InfoPanelText" ) );
38 m_InfoPanel = layoutRoot.FindAnyWidget(
"InfoPanel" );
42 m_MenuFadeInIncrement = 1 / MENU_FADEIN_TIME;
43 m_LogoFadeInIncrement = 1 / LOGO_FADEIN_TIME;
44 m_ScrollIncrement = CREDIT_SCROLL_SPEED * (
y / 1080 );
46 m_Scroller.VScrollToPos01( 0 );
47 m_Scroller.GetScreenSize( x_f, m_ScrollSize );
49 GetGame().GameScript.Call(
this,
"LoadDataAsync",
null );
59 for(
int i = 1; i <= m_CreditsData.Departments.Count(); i++ )
61 ref CreditsDepartmentElement e =
new CreditsDepartmentElement( i, m_Content, m_CreditsData.Departments.Get( i - 1 ) );
62 m_CreditsEntries.Insert( e );
67 override void Update(
float timeslice )
70 if( m_LogoFadeInLevel != 1 )
72 new_menu_val = m_MenuFadeInLevel + m_MenuFadeInIncrement * timeslice;
73 if( new_menu_val < 1 )
74 m_MenuFadeInLevel = new_menu_val;
76 m_MenuFadeInLevel = 1;
78 if( m_MenuFadeInLevel > 0.5 )
80 float new_logo_val = m_LogoFadeInLevel + m_LogoFadeInIncrement * timeslice;
81 if( new_menu_val < 1 )
82 m_LogoFadeInLevel = new_logo_val;
84 m_LogoFadeInLevel = 1;
87 layoutRoot.SetAlpha( m_MenuFadeInLevel );
88 m_Logo.SetAlpha( m_LogoFadeInLevel );
89 m_InfoPanelText.SetAlpha( m_MenuFadeInLevel );
91 else if( m_ScrollLevel + m_ScrollSize <= m_Scroller.GetContentHeight() )
93 float new_scroll_val = m_ScrollLevel + m_ScrollIncrement * timeslice;
94 m_ScrollLevel = new_scroll_val;
95 m_Scroller.VScrollToPos( m_ScrollLevel );
99 new_menu_val = m_MenuFadeInLevel2 - m_MenuFadeInIncrement * timeslice;
100 if( new_menu_val > 0 )
101 m_MenuFadeInLevel2 = new_menu_val;
105 layoutRoot.SetAlpha( m_MenuFadeInLevel2 );
106 m_InfoPanelText.SetAlpha( m_MenuFadeInLevel2 );
109 m_CurrentTime += timeslice;
117 void UpdateInfoPanelText(
int input_device_type)
121 m_InfoPanelText.SetText(
"ESC " +
"#menu_back");
125 m_InfoPanelText.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUIBack",
"#menu_back", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));