1class MainMenuNewsfeed
extends ScriptedWidgetEventHandler
5 protected Widget m_DLDLC;
6 protected Widget m_Discord;
7 protected Widget m_Feedback;
8 protected Widget m_DayZForum;
9 protected Widget m_Twitter;
10 protected Widget m_Youtube;
12 protected TextWidget m_MainText1;
13 protected TextWidget m_MainText2;
14 protected TextWidget m_MainText3;
15 protected TextWidget m_SecText1;
16 protected TextWidget m_SecText2;
17 protected TextWidget m_SecText3;
19 void MainMenuNewsfeed( Widget root )
23 m_DLDLC =
m_Root.FindAnyWidget(
"downloaddlc" );
24 m_Discord =
m_Root.FindAnyWidget(
"discord" );
25 m_Feedback =
m_Root.FindAnyWidget(
"feedback_tracker" );
26 m_DayZForum =
m_Root.FindAnyWidget(
"dayz_forums" );
27 m_Twitter =
m_Root.FindAnyWidget(
"twitter" );
28 m_Youtube =
m_Root.FindAnyWidget(
"youtube" );
30 m_MainText1 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoT1" ) );
31 m_MainText2 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoT2" ) );
32 m_MainText3 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoT3" ) );
33 m_SecText1 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoC1" ) );
34 m_SecText2 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoC2" ) );
35 m_SecText3 = TextWidget.Cast(
m_Root.FindAnyWidget(
"SGInfoC3" ) );
45 m_MainText1.SetText(
"#layout_mainmenu_newsfeed_sgz_title_1" );
47 m_MainText2.SetText(
"#layout_mainmenu_newsfeed_sgz_title_2" );
49 m_MainText3.SetText(
"#layout_mainmenu_newsfeed_sgz_title_3" );
51 m_SecText1.SetText(
"#layout_mainmenu_newsfeed_sgz_text_1" );
53 m_SecText2.SetText(
"#layout_mainmenu_newsfeed_sgz_text_2" );
55 m_SecText3.SetText(
"#layout_mainmenu_newsfeed_sgz_text_3" );
66 GetGame().
OpenURL(
"https://store.steampowered.com/app/830660/Survivor_GameZ/" );
94 override bool OnClick( Widget w,
int x,
int y,
int button )
103 else if ( w == m_Discord )
108 else if ( w == m_Feedback )
113 else if ( w == m_DayZForum )
118 else if ( w == m_Twitter )
123 else if ( w == m_Youtube )
142 override bool OnMouseLeave( Widget w, Widget enterW,
int x,
int y )
146 ColorWhite( w, enterW,
x,
y );
152 override bool OnFocus( Widget w,
int x,
int y )
166 ColorWhite( w, null,
x,
y );
176 return ( w == m_DLDLC || w == m_Discord || w == m_Feedback || w == m_DayZForum || w == m_Twitter || w == m_Youtube );
182 void ColorRed( Widget w,
int x,
int y )
185 if( w.IsInherited( ButtonWidget ) )
187 ButtonWidget button = ButtonWidget.Cast( w );
188 button.SetTextColor(
ARGB( 255, 255, 0, 0 ) );
189 button.SetAlpha( 0.9 );
192 TextWidget text = TextWidget.Cast(w.FindWidget( w.GetName() +
"_text" ) );
193 TextWidget text2 = TextWidget.Cast(w.FindWidget( w.GetName() +
"_text_1" ) );
194 ImageWidget image = ImageWidget.Cast( w.FindWidget( w.GetName() +
"_image" ) );
198 text.SetColor(
ARGB( 255, 255, 0, 0 ) );
203 text2.SetColor(
ARGB( 255, 255, 0, 0 ) );
208 image.SetColor(
ARGB( 255, 255, 0, 0 ) );
212 void ColorWhite( Widget w, Widget enterW,
int x,
int y )
214 if( w.IsInherited( ButtonWidget ) )
216 ButtonWidget button = ButtonWidget.Cast( w );
217 button.SetTextColor(
ARGB( 255, 255, 255, 255 ) );
218 button.SetAlpha( 0.75 );
221 TextWidget text = TextWidget.Cast(w.FindWidget( w.GetName() +
"_text" ) );
222 TextWidget text2 = TextWidget.Cast(w.FindWidget( w.GetName() +
"_text_1" ) );
223 ImageWidget image = ImageWidget.Cast( w.FindWidget( w.GetName() +
"_image" ) );
227 text.SetColor(
ARGB( 255, 255, 255, 255 ) );
232 text2.SetColor(
ARGB( 255, 255, 255, 255 ) );
237 image.SetColor(
ARGB( 255, 255, 255, 255 ) );
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
proto native void OpenURL(string url)
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
proto native CGame GetGame()
int ARGB(int a, int r, int g, int b)
override bool OnFocusLost(Widget w, int x, int y)
bool IsFocusable(Widget w)
override bool OnFocus(Widget w, int x, int y)