10 [
Attribute(
"{75C912A1C89BE6C2}UI/layouts/WidgetLibrary/Buttons/WLib_ButtonText.layout")]
11 protected ResourceName m_sUIRequestButtonResource;
13 [
Attribute(
"0", UIWidgets.ComboBox,
"Request type",
"", ParamEnumArray.FromEnum(SCR_EUIRequestType))]
14 protected SCR_EUIRequestType m_eRequestType;
16 [
Attribute(
"", UIWidgets.LocaleEditBox,
"Request button text.")]
24 m_LocallyRequestedTask = requestedTask;
30 return m_LocallyRequestedTask;
39 int taskID, requesterID;
40 taskID = task.GetTaskID();
43 Rpc(RPC_SetRequester, taskID, requesterID);
44 RPC_SetRequester(taskID, requesterID);
48 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
49 void RPC_SetRequester(
int taskID,
int requesterID)
62 task.SetRequester(requester);
66 vector GetRequestPosition()
82 return (!supportEntity.GetLocallyRequestedTask());
86 void SetRequestButtonText(notnull TextWidget textWidget)
88 textWidget.SetTextFormat(m_sRequestButtonText);
107 protected override void RegisterContextualMenuCallbacks()
109 if (m_sRequestButtonText.IsEmpty())
120 entry.SetName(m_sRequestButtonText);
121 entry.SetSupportClass(
this);
122 entry.GetOnPerform().Insert(Request);
125 radialMenu.InsertCustomRadialEntry(entry);
129 Widget CreateButtonAndSetPadding(Widget parentWidget, notnull inout array<Widget> widgets,
float left = 4,
float top = 4,
float right = 4,
float bottom = 4)
131 Widget requestButtonLayout =
GetGame().GetWorkspace().CreateWidgets(m_sUIRequestButtonResource, parentWidget);
132 if (!requestButtonLayout)
135 ButtonWidget requestButton = ButtonWidget.Cast(requestButtonLayout.FindAnyWidget(
"Button"));
139 if (requestTaskComponent)
140 requestTaskComponent.SetRequestType(m_eRequestType);
143 VerticalLayoutSlot.SetPadding(requestButtonLayout, left, top, right, bottom);
145 TextWidget textWidget = TextWidget.Cast(requestButtonLayout.FindAnyWidget(
"Text"));
147 SetRequestButtonText(textWidget);
149 widgets.Insert(requestButtonLayout);
151 return requestButtonLayout;