6 protected ScrollWidget m_Scroll;
13 protected ModsMenuTooltip m_Tooltip;
14 protected ref
Timer m_TooltipTimer;
19 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/mods_menu/mods_menu_detailed.layout", parent);
20 m_Content =
m_Root.FindAnyWidget(
"ModsDetailedContent");
21 m_Scroll = ScrollWidget.Cast(
m_Root.FindAnyWidget(
"ModsDetailedScroller"));
33 void ~ModsMenuDetailed()
41 m_Scroll.VScrollToPos( 0 );
43 GetGame().GetMission().GetOnModMenuVisibilityChanged().Invoke(
false);
50 GetGame().GetMission().GetOnModMenuVisibilityChanged().Invoke(
true);
65 Highlight(
m_Data.GetKey( 0 ) );
68 void Highlight(
ModInfo mod_ref )
72 m_Data.Get( m_Highlighted ).Deselect();
76 m_Highlighted = mod_ref;
79 m_Data.Get( m_Highlighted ).Select();
81 ScrollToMod( m_Highlighted );
85 void ScrollToMod(
ModInfo mod_ref )
118 void Select(
ModInfo mod_ref,
bool show )
124 m_Highlighted = mod_ref;
125 m_Data.Get( mod_ref ).Select();
129 m_Data.Get( mod_ref ).Deselect();
130 if ( m_Highlighted == mod_ref )
132 m_Highlighted =
null;
137 ScrollToMod( m_Highlighted );
140 void PrepareTooltip(
ModInfo mod_ref )
144 m_TooltipMod = mod_ref;
145 if ( !m_TooltipTimer )
148 m_TooltipTimer.Run( 1,
this,
"ShowTooltip" );
155 m_Tooltip.ShowTooltip( m_TooltipMod );
160 if ( m_TooltipTimer )
161 m_TooltipTimer.Stop();
165 m_Tooltip.HideTooltip();
172 ModsMenuDetailedEntry entry =
new ModsMenuDetailedEntry(var, m_Content,
this);
173 m_Data.Insert(var, entry);
177 float y_c = m_Scroll.GetContentHeight();
179 m_Content.GetScreenSize(
x,
y );
182 m_Scroll.SetAlpha( 1 );