1class ModsMenuSimpleEntry
extends ScriptedWidgetEventHandler
3 protected ButtonWidget m_ModButton;
4 protected ImageWidget m_Icon;
5 protected Widget m_Hover;
7 protected bool m_HasLogoOver;
9 protected ModsMenuSimple m_ParentMenu;
11 void ModsMenuSimpleEntry(
ModInfo data,
int index, Widget parent, ModsMenuSimple parent_menu)
13 m_ModButton = ButtonWidget.Cast(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/mods_menu/mods_menu_simple_entry.layout", parent));
14 m_Icon = ImageWidget.Cast(m_ModButton.FindAnyWidget(
"Icon"));
15 m_Hover = m_ModButton.FindAnyWidget(
"Overlay");
17 m_ParentMenu = parent_menu;
19 m_ModButton.SetSort(index);
20 m_ModButton.SetHandler(
this);
25 void ~ModsMenuSimpleEntry()
32 string logo =
m_Data.GetLogo();
33 string logo_over =
m_Data.GetLogoOver();
37 m_Icon.LoadImageFile(0, logo);
41 m_Icon.LoadImageFile(0,
ModInfo.DEFAULT_LOGO);
46 m_Icon.LoadImageFile(1, logo_over);
50 m_Icon.LoadImageFile(1,
ModInfo.DEFAULT_LOGO_OVER);
55 override bool OnClick(Widget w,
int x,
int y,
int button)
57 if( w == m_ModButton )
59 m_ParentMenu.Select(
m_Data );
67 if( w == m_ModButton )
79 if( enterW != m_ModButton )
83 m_Hover.Show(
false );
89 override bool OnFocus( Widget w,
int x,
int y )
91 if( w == m_ModButton )
103 if( w == m_ModButton )
106 m_Icon.SetImage( 0 );
107 m_Hover.Show(
false );
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
proto native CGame GetGame()
override bool OnFocusLost(Widget w, int x, int y)
override bool OnFocus(Widget w, int x, int y)