Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BrowserListMenuEntryComponent.c
Go to the documentation of this file.
1/*
2Adds handling of favorites visualization for Scenarios and Servers browser menus
3*/
6typedef ScriptInvokerBase<ScriptInvokerBrowserListMenuEntryMethod> ScriptInvokerBrowserListMenuEntry;
7
9{
10 protected static const string BUTTON_FAVORITE = "FavoriteButton";
11
12 protected ref SCR_ModularButtonComponent m_FavoriteButton;
13 protected bool m_bFavorite;
14
16
17 //------------------------------------------------------------------------------------------------
18 override void HandlerAttached(Widget w)
19 {
20 Widget favoriteButton = w.FindAnyWidget(BUTTON_FAVORITE);
21 if (favoriteButton)
22 m_FavoriteButton = SCR_ModularButtonComponent.FindComponent(favoriteButton);
23
25 {
27 m_FavoriteButton.m_OnClicked.Insert(OnFavoriteClicked);
28 }
29
30 super.HandlerAttached(w);
31 }
32
33 //------------------------------------------------------------------------------------------------
34 override void UpdateModularButtons()
35 {
36 super.UpdateModularButtons();
37
39 }
40
41 //------------------------------------------------------------------------------------------------
42 protected void OnFavoriteClicked(SCR_ModularButtonComponent comp)
43 {
45 }
46
47 //------------------------------------------------------------------------------------------------
48 bool SetFavorite(bool favorite)
49 {
51 m_FavoriteButton.SetToggled(favorite);
52
53 if (m_bFavorite == favorite)
54 return false;
55
56 m_bFavorite = favorite;
57
58 if (m_OnFavorite)
59 m_OnFavorite.Invoke(this, favorite);
60
61 return true;
62 }
63
64 //------------------------------------------------------------------------------------------------
66 {
67 return m_bFavorite;
68 }
69
70 //------------------------------------------------------------------------------------------------
78}
func ScriptInvokerBrowserListMenuEntryMethod
ScriptInvokerBase< ScriptInvokerBrowserListMenuEntryMethod > ScriptInvokerBrowserListMenuEntry
bool IsFavorite()
ref SCR_ModularButtonComponent m_FavoriteButton
ref ScriptInvokerBrowserListMenuEntry m_OnFavorite
bool m_bFavorite
ScriptInvokerBrowserListMenuEntry GetOnFavorite()
override void HandlerAttached(Widget w)
override void UpdateModularButtons()
static const string BUTTON_FAVORITE
void OnFavoriteClicked(SCR_ModularButtonComponent comp)
bool SetFavorite(bool favorite)
bool m_bUnavailable
bool m_bFocused
ref array< SCR_ModularButtonComponent > m_aMouseButtons