4 protected const string TEXT_OWNED =
"#layout_dlc_owned";
5 protected const string TEXT_UNOWNED =
"#layout_dlc_unowned";
7 protected int m_ColorBackgroundOriginal;
10 protected Widget m_BannerFrame;
11 protected Widget m_Background;
12 protected Widget m_StoreButton;
13 protected Widget m_GamepadStoreImage;
14 protected ImageWidget m_DlcPromotionImage;
16 protected MultilineTextWidget m_DescriptionTextDlc;
17 protected VideoWidget m_VideoWidget;
18 protected ref
ModInfo m_ThisModInfo;
21 protected ref BannerHandlerBase m_BannerHandler;
25 CreateRootWidget(parent);
31 #ifdef PLATFORM_CONSOLE
40 void ~MainMenuDlcHandlerBase()
42 #ifdef PLATFORM_CONSOLE
43 if (
GetGame().GetContentDLCService())
51 m_StoreButton =
m_Root.FindAnyWidget(
"dlc_openStore");
52 SetPlatformSpecifics();
53 m_VideoWidget = VideoWidget.Cast(
m_Root.FindAnyWidget(
"dlc_Video"));
54 m_VideoWidget.Show(
false);
55 m_DlcPromotionImage = ImageWidget.Cast(
m_Root.FindAnyWidget(
"dlc_ImageMain"));
56 m_DlcPromotionImage.Show(
true);
57 m_BannerFrame =
m_Root.FindAnyWidget(
"dlc_BannerFrame");
58 m_BannerHandler =
new BannerHandlerBase(m_BannerFrame);
60 m_DescriptionTextDlc = MultilineTextWidget.Cast(
m_Root.FindAnyWidget(
"dlc_Description"));
61 m_DescriptionTextDlc.SetLineBreakingOverride(LinebreakOverrideMode.LINEBREAK_WESTERN);
62 m_ColorBackgroundOriginal = m_Background.GetColor();
64 UpdateAllPromotionInfo();
68 void CreateRootWidget(
Widget parent)
70 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/dlc_panels/DLC_Panel.layout", parent);
73 void ShowInfoPanel(
bool show)
76 OnPanelVisibilityChanged();
79 bool IsInfoPanelVisible()
84 void OnPanelVisibilityChanged()
86 UpdateAllPromotionInfo();
98 m_ThisModInfo.GoToStore();
99 return super.OnClick(w,
x,
y,button);
105 if (m_VideoWidget.GetState() !=
VideoState.NONE)
108 string path =
"video\\" + m_DlcInfo.VideoFileName;
109 if (m_DlcInfo.VideoFileName !=
"")
110 return m_VideoWidget.Load(
path,
true);
118 m_VideoWidget.Play();
123 m_VideoWidget.Stop();
128 m_VideoWidget.Pause();
133 m_VideoWidget.Stop();
134 m_VideoWidget.Unload();
137 protected void ColorFocussed(
Widget w,
int x,
int y)
139 m_Background.SetColor(
ARGB(255,54,16,16));
142 protected void ColorUnfocussed(
Widget w,
Widget enterW,
int x,
int y)
144 m_Background.SetColor(m_ColorBackgroundOriginal);
147 protected void UpdateOwnedStatus()
151 if (m_ThisModInfo.GetIsOwned())
153 m_BannerHandler.SetBannerColor(
Colors.COLOR_LIVONIA_EMERALD_GREEN);
154 m_BannerHandler.SetBannerText(TEXT_OWNED);
158 m_BannerHandler.SetBannerColor(
Colors.COLOR_DAYZ_RED);
159 m_BannerHandler.SetBannerText(TEXT_UNOWNED);
169 protected void SetPlatformSpecifics()
173 m_GamepadStoreImage =
m_Root.FindAnyWidget(
"image_button_ps");
174 desc.SetText(
"#dlc_open_store_PS");
176 m_GamepadStoreImage =
m_Root.FindAnyWidget(
"image_button_xbox");
177 desc.SetText(
"#dlc_open_store");
182 protected void UpdateAllPromotionInfo()
186 UpdateIconVisibility();
189 protected void UpdateDlcData()
191 m_TitleTextDlc.SetText(m_DlcInfo.HeaderText);
192 m_DescriptionTextDlc.SetText(m_DlcInfo.DescriptionText);
195 protected void UpdateIconVisibility()
197 #ifdef PLATFORM_CONSOLE
204 UpdateIconVisibility();
209 return m_ThisModInfo;