Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_ToolbarContextBrowserBuildingUIComponent.c
Go to the documentation of this file.
1
2
class
SCR_ToolbarContextBrowserBuildingUIComponent
:
ScriptedWidgetComponent
3
{
4
[
Attribute
(
"BrowserButton"
)]
5
protected
string
m_sOpenContentBrowserButtonName
;
6
7
[
Attribute
()]
8
protected
ref
SCR_EditorContentBrowserDisplayConfig
m_ContentBrowserDisplayConfig
;
9
10
//------------------------------------------------------------------------------------------------
11
protected
void
OpenAssetBrowserButton
(
Widget
widget,
float
value,
EActionTrigger
actionTrigger)
12
{
13
PlayerController playerController =
GetGame
().GetPlayerController();
14
if
(!playerController)
15
return
;
16
17
ChimeraCharacter
char
=
ChimeraCharacter
.Cast(playerController.GetControlledEntity());
18
if
(!
char
)
19
return
;
20
21
FactionAffiliationComponent factionComp = FactionAffiliationComponent.Cast(
char
.FindComponent(FactionAffiliationComponent));
22
if
(!factionComp)
23
return
;
24
25
SCR_CampaignFaction
faction =
SCR_CampaignFaction
.Cast(factionComp.GetAffiliatedFaction());
26
if
(!faction)
27
return
;
28
29
// Get all display config data from attribute
30
bool
saveBrowserState;
31
array<EEditableEntityLabel> alwaysActiveLabels = {}, whitelistLabels = {};
32
m_ContentBrowserDisplayConfig
.GetAlwaysActiveLabels(alwaysActiveLabels);
33
m_ContentBrowserDisplayConfig
.GetWhiteListeLabels(whitelistLabels);
34
array<EEditableEntityLabelGroup> whitelistLabelGroups = {};
35
m_ContentBrowserDisplayConfig
.GetWhiteListeLabelGroups(whitelistLabelGroups);
36
37
LocalizedString
browserHeader =
m_ContentBrowserDisplayConfig
.GetHeader();
38
saveBrowserState =
m_ContentBrowserDisplayConfig
.GetSaveContentBrowserState();
39
40
// Add player's current faction as always active label
41
EEditableEntityLabel
factionLabel = faction.GetFactionLabel();
42
alwaysActiveLabels.Insert(factionLabel);
43
44
SCR_EditorContentBrowserDisplayConfig
displayConfig =
new
SCR_EditorContentBrowserDisplayConfig
(whitelistLabelGroups, whitelistLabels, alwaysActiveLabels, saveBrowserState, browserHeader);
45
46
SCR_ContentBrowserEditorComponent
contentBrowserManager =
SCR_ContentBrowserEditorComponent
.Cast(
SCR_ContentBrowserEditorComponent
.GetInstance(
SCR_ContentBrowserEditorComponent
));
47
if
(contentBrowserManager)
48
contentBrowserManager.
OpenBrowserLabelConfigInstance
(displayConfig);
49
}
50
51
//------------------------------------------------------------------------------------------------
52
override
void
HandlerAttached
(
Widget
w)
53
{
54
Widget
buttonWidget = w.FindAnyWidget(
m_sOpenContentBrowserButtonName
);
55
if
(buttonWidget)
56
ButtonActionComponent
.GetOnAction(buttonWidget).Insert(
OpenAssetBrowserButton
);
57
}
58
}
EEditableEntityLabel
EEditableEntityLabel
Definition
EEditableEntityLabel.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ButtonActionComponent
Component to execute action when the button or its shortcut is pressed.
Definition
ButtonActionComponent.c:3
ChimeraCharacter
Definition
ChimeraCharacter.c:13
LocalizedString
Definition
LocalizedString.c:22
SCR_CampaignFaction
Definition
SCR_CampaignFaction.c:2
SCR_ContentBrowserEditorComponent
Definition
SCR_ContentBrowserEditorComponent.c:17
SCR_ContentBrowserEditorComponent::OpenBrowserLabelConfigInstance
static bool OpenBrowserLabelConfigInstance(SCR_EditorContentBrowserDisplayConfig contentBrowserConfig=null)
Definition
SCR_ContentBrowserEditorComponent.c:974
SCR_EditorContentBrowserDisplayConfig
Definition
SCR_EditorContentBrowserDisplayConfig.c:6
SCR_ToolbarContextBrowserBuildingUIComponent
Load a proper config file for player faction and open an asset browser.
Definition
SCR_ToolbarContextBrowserBuildingUIComponent.c:3
SCR_ToolbarContextBrowserBuildingUIComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ToolbarContextBrowserBuildingUIComponent.c:52
SCR_ToolbarContextBrowserBuildingUIComponent::m_sOpenContentBrowserButtonName
string m_sOpenContentBrowserButtonName
Definition
SCR_ToolbarContextBrowserBuildingUIComponent.c:5
SCR_ToolbarContextBrowserBuildingUIComponent::m_ContentBrowserDisplayConfig
ref SCR_EditorContentBrowserDisplayConfig m_ContentBrowserDisplayConfig
Definition
SCR_ToolbarContextBrowserBuildingUIComponent.c:8
SCR_ToolbarContextBrowserBuildingUIComponent::OpenAssetBrowserButton
void OpenAssetBrowserButton(Widget widget, float value, EActionTrigger actionTrigger)
Definition
SCR_ToolbarContextBrowserBuildingUIComponent.c:11
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
Game
Editor
UI
Components
Toolbar
SCR_ToolbarContextBrowserBuildingUIComponent.c
Generated by
1.17.0