1class ModsMenuDetailedEntry
extends ScriptedWidgetEventHandler
4 protected Widget m_Detail;
7 protected ImageWidget m_IconSmall;
8 protected ImageWidget m_IconCollapse;
9 protected TextWidget
m_Name;
12 protected ImageWidget m_IconBig;
13 protected MultilineTextWidget m_Author;
14 protected TextWidget m_Version;
22 protected ModsMenuDetailed m_ParentMenu;
23 protected bool m_IsOpen;
25 void ModsMenuDetailedEntry(
ModInfo data, Widget parent, ModsMenuDetailed parent_menu)
27 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/mods_menu/mods_menu_detailed_entry.layout", parent);
28 m_Detail =
m_Root.FindAnyWidget(
"DetailContainer");
30 m_IconSmall = ImageWidget.Cast(
m_Root.FindAnyWidget(
"IconSmall"));
31 m_IconCollapse = ImageWidget.Cast(
m_Root.FindAnyWidget(
"collapse_button"));
32 m_IconCollapse.LoadImageFile( 1,
"set:dayz_gui image:icon_open" );
35 m_IconBig = ImageWidget.Cast(
m_Root.FindAnyWidget(
"IconBig"));
36 m_Author = MultilineTextWidget.Cast(
m_Root.FindAnyWidget(
"Author"));
37 m_Author.SetLineBreakingOverride(LinebreakOverrideMode.LINEBREAK_WESTERN);
39 m_Version = TextWidget.Cast(
m_Root.FindAnyWidget(
"Version"));
43 m_ActionPurchase.SetText(
"#mod_detail_info_store_PS");
46 m_ActionPurchase.SetText(
"#mod_detail_info_store_Xbox");
52 m_ParentMenu = parent_menu;
59 void ~ModsMenuDetailedEntry()
74 m_IconBig.Show(
true );
75 m_IconSmall.Show(
false );
76 m_IconCollapse.SetImage( 1 );
87 m_IconBig.Show(
false );
88 m_IconSmall.Show(
true );
89 m_IconCollapse.SetImage( 0 );
97 string picture =
m_Data.GetPicture();
98 string logo =
m_Data.GetLogoSmall();
100 string description =
m_Data.GetOverview();
101 string author =
m_Data.GetAuthor();
102 string version =
m_Data.GetVersion();
103 string action =
m_Data.GetAction();
108 m_IconBig.LoadImageFile(0, picture);
112 m_IconBig.LoadImageFile(0, logo);
116 m_IconBig.LoadImageFile(0,
ModInfo.DEFAULT_PICTURE);
122 m_IconSmall.LoadImageFile(0, logo);
124 else if (picture !=
"")
126 m_IconSmall.LoadImageFile(0, picture);
130 m_IconSmall.LoadImageFile(0,
ModInfo.DEFAULT_LOGO_SMALL);
138 if (description !=
"")
151 m_Author.Show(
true );
152 m_Author.SetText(author);
157 m_Version.Show(
true );
158 m_Version.SetText(version);
161 #ifdef PLATFORM_WINDOWS
164 m_ActionWebsite.Show(
true );
170 bool isOwned =
m_Data.GetIsOwned();
171 m_Root.FindAnyWidget(
"ModOwnership").Show(
true );
172 m_Root.FindAnyWidget(
"Owned").Show( isOwned );
173 m_Root.FindAnyWidget(
"Unowned").Show( !isOwned );
174 m_ActionPurchase.Show(
true );
175 m_Version.Show(
false );
181 if (w == m_IconCollapse)
183 m_ParentMenu.Select(
m_Data, !m_IsOpen);
186 else if (w == m_ActionWebsite)
190 else if (w == m_ActionPurchase)
200 if (w == m_ActionWebsite)
201 m_ActionWebsite.SetBold(
true);
203 if (w == m_ActionPurchase)
204 m_ActionPurchase.SetBold(
true);
208 if (
m_Data.GetTooltip() !=
"")
209 m_ParentMenu.PrepareTooltip(
m_Data);
219 if (w == m_ActionWebsite)
220 m_ActionWebsite.SetBold(
false);
222 if (w == m_ActionPurchase)
223 m_ActionPurchase.SetBold(
false );
227 m_ParentMenu.HideTooltip();
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native void OpenURL(string url)
proto native CGame GetGame()
string m_Description
class purpose description
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.