23 #ifdef PLATFORM_CONSOLE
24 protected ImageWidget m_NextPageBtnIconConsole;
25 protected ImageWidget m_PrevPageBtnIconConsole;
36 #ifdef PLATFORM_CONSOLE
49 m_Root =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/news_carousel.layout", parent);
62 #ifdef PLATFORM_CONSOLE
64 m_NextPageBtnIconConsole = ImageWidget.Cast(
m_Root.FindAnyWidget(
"next_icon_console"));
65 m_PrevPageBtnIconConsole = ImageWidget.Cast(
m_Root.FindAnyWidget(
"prev_icon_console"));
68 m_NextPageBtnIconConsole.LoadImageFile(0,
"set:xbox_buttons image:DPAD_right");
69 m_PrevPageBtnIconConsole.LoadImageFile(0,
"set:xbox_buttons image:DPAD_left");
71 m_NextPageBtnIconConsole.LoadImageFile(0,
"set:playstation_buttons image:DPAD_right");
72 m_PrevPageBtnIconConsole.LoadImageFile(0,
"set:playstation_buttons image:DPAD_left");
76 #ifdef PLATFORM_CONSOLE
90 #ifdef PLATFORM_CONSOLE
158 for (
int i = 0; i < newsData.News.Count(); i++)
166 if (modInfo && !modInfo.GetIsOwned())
185 if (articlesCount == 0)
192 if (articlesCount == 1)
194 Widget pageIndicators =
m_Root.FindAnyWidget(
"nf_pages");
197 pageIndicators.Show(
false);
200 #ifndef PLATFORM_CONSOLE
203 m_NextPageBtnIconConsole.Show(
false);
210 Widget w =
m_Root.FindAnyWidget(
"page" + j);
214 if (j > articlesCount)
230 int maxColums = (articlesCount - 1);
264 ImageWidget imageW = ImageWidget.Cast(
m_Root.FindAnyWidget(
"nf_image" + index));
267 if (article.coverImage !=
"")
269 imageW.LoadImageFile(0, article.coverImage);
276 Widget w =
m_Root.FindAnyWidget(
"page" + i);
280 if ((i - 1) == index)
293 Widget focusW = GetWidgetUnderCursor();
306 w.SetColor(
ARGB(255, 255, 0, 0));
311 w.SetColor(
ARGB(140, 0, 0, 0));
376 #ifdef PLATFORM_CONSOLE
379 m_NextPageBtnIconConsole.Show(state);
385 if (
g_Game.GetInput().IsEnabledMouseAndKeyboard())
398 #ifdef PLATFORM_CONSOLE
401 m_PrevPageBtnIconConsole.Show(state);
407 if (
g_Game.GetInput().IsEnabledMouseAndKeyboard())
431 if (article.fullUrl !=
"")
433 g_Game.OpenURL(article.fullUrl);
438 override bool OnClick(Widget w,
int x,
int y,
int button)
512 switch (pInputDeviceType)
520 #ifdef PLATFORM_CONSOLE
521 m_NextPageBtnIconConsole.Show(showNext);
522 m_PrevPageBtnIconConsole.Show(showPrevious);
528 if (
g_Game.GetInput().IsEnabledMouseAndKeyboard())
532 #ifdef PLATFORM_CONSOLE
533 m_NextPageBtnIconConsole.Show(
false);
534 m_PrevPageBtnIconConsole.Show(
false);
547 #ifdef PLATFORM_WINDOWS
548 shopLabel =
"#dlc_open_store";
551 #ifdef PLATFORM_CONSOLE
552 #ifdef PLATFORM_MSSTORE
553 shopLabel =
"#dlc_open_store_Xbox";
556 shopLabel =
"#dlc_open_store_Xbox";
558 shopLabel =
"#dlc_open_store_PS";
571 shopLabel =
"#dlc_news_wishlist";
575 shopLabel =
"#dlc_news_comingsoon";
581 shopLabel =
"#dlc_news_learn_more";
587 string label = shopLabel;
588 string linkIcon =
string.Format(
"<image set=\"%1\" name=\"%2\" scale=\"%3\"/>",
"dayz_gui",
"externallink", 0.9);
595 string fullLabel =
string.Format(
"<color rgba=\"%1\">%2 %3</color>", color, label, linkIcon);
597 fullLabel =
string.Format(
"<color rgba=\"%1\">%2</color>", color, label);
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
enum AnimatedGridSpacerEasingType m_GridSpacer
void AnimatedGridSpacer(Widget gridSpacer, int maxColums, float animDuration=0.25, AnimatedGridSpacerEasingType easing=AnimatedGridSpacerEasingType.EASE_IN_OUT_CUBIC)
AnimatedGridSpacerEasingType
static JsonDataNewsList GetNewsData()
static ModInfo GetDLCModInfoByName(string dlcName)
DLCs only.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
ButtonWidget m_NextPageBtn
ButtonWidget m_PrevPageBtn
void OnClickPreviousArticle()
ref array< JsonDataNewsArticle > m_NewsArticles
ImageWidget m_NextPageBtnIcon
RichTextWidget m_HotlinkButtonLabel
void UpdateCarouselInfo()
void ShowArrowRight(bool state)
ref AnimatedGridSpacer m_AnimatedSpacer
ButtonWidget m_HotlinkButton
void OnClickNextArticle()
JsonDataNewsArticle m_CurrentArticle
const float ARTICLE_SWITCH_TIME
enum NewsCategory MAX_ARTICLES
void ShowArrowLeft(bool state)
ref Timer m_NewsSwitchTimer
void ColorNormal(Widget w)
EInputDeviceType m_CurrentInputDevice
string GetButtonLabel(string color)
void OnAnimationCompleted()
ImageWidget m_PrevPageBtnIcon
void NewsCarousel(Widget parent, UIScriptedMenu mainMenu)
void ColorHighlight(Widget w)
void ShowNewsCarousel(bool show)
int ARGB(int a, int r, int g, int b)
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)