Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BuilderNameTooltipDetail.c
Go to the documentation of this file.
1
4{
5 protected const string AUTHOR_TEXT_WIDGET_NAME = "Text";
6 protected const string PLATFORM_ICON_WIDGET_NAME = "PlatformIcon";
7
8 //---- REFACTOR NOTE START: Searching for "Text" dirrectly
9
10 //------------------------------------------------------------------------------------------------
11 override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
12 {
13 TextWidget text = TextWidget.Cast(widget.FindAnyWidget(AUTHOR_TEXT_WIDGET_NAME));
14 if (!text)
15 return false;
16
17 BaseGameMode gameMode = GetGame().GetGameMode();
18 if (!gameMode)
19 return false;
20
21 const int authorId = entity.GetAuthorPlayerID();
22 if (authorId <= 0) //SCR_EditableEntityComponent.GetAuthorPlayerID can return 0 when there is no author
23 return false;
24
25 const string name = SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(authorId);
27 return false;
28
29 text.SetText(name);
30
31 const PlatformKind authorPlatform = entity.GetAuthorPlatform();
32 ImageWidget platformIcon = ImageWidget.Cast(widget.FindAnyWidget(PLATFORM_ICON_WIDGET_NAME));
33 if (platformIcon && authorPlatform != PlatformKind.NONE)
34 {
36 if (playerController)
37 playerController.SetPlatformImageToKind(authorPlatform, platformIcon, showOnPC: true, showOnXbox: true);
38 }
39
40 return true;
41 }
42
43 //---- REFACTOR NOTE END ----
44}
ArmaReforgerScripted GetGame()
Definition game.c:1398
PlatformKind
Definition PlatformKind.c:8
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
static bool IsEmptyOrWhiteSpace(string input)
proto external PlayerController GetPlayerController()