14 override bool _WB_GetCustomTitle(
BaseContainer source, out
string title)
18 source.Get(
"m_sGroupTag", groupTag);
22 source.Get(
"m_sPropertyName", name);
26 source.Get(
"m_sClassTag", classTag);
31 if (!groupTag.IsEmpty())
32 title += groupTag +
": ";
39 if (!classTag.IsEmpty())
40 title +=
string.Format(
"(%1)", classTag);
58 source.Get(
"m_Label", label);
62 source.Get(
"m_PropertyName", property);
65 title = label +
": " + property;
74class SCR_LocalizedProperty
80 string m_sPropertyName;
82 void SCR_LocalizedProperty(
string label,
string propertyName)
84 if (m_sLabel.IsEmpty())
87 if (m_sPropertyName.IsEmpty())
88 m_sPropertyName = propertyName;
95class SCR_LocalizedPropertyExtended : SCR_LocalizedProperty
98 ref array<string> m_aInfo;
100 void SCR_LocalizedPropertyExtended(
string label,
string propertyName, array<string> info)
103 m_sPropertyName = propertyName;
121 [
Attribute(
"{0022F0B45ADBC5AC}UI/layouts/WidgetLibrary/EditBox/WLib_EditBox.layout",
UIWidgets.ResourceNamePicker,
"What kind of widget should be generated for this value",
"layout")]
307 BaseContainer container = rsc.GetResource().ToBaseContainer();
381 protected float m_iOffsetTop;
384 protected float m_iOffsetBottom;
387 protected float m_iLeftBottom;
397 wText.SetText(m_sLabel);
398 VerticalLayoutSlot.SetPadding(wText, m_iLeftBottom, m_iOffsetTop, 0, m_iOffsetBottom);
400 m_sClassTag =
"label";
405 wText.SetVisible(m_bShow);
420 [
Attribute(
"5",
UIWidgets.EditBox,
"In how many seconds should editbox error should be cleared after focus")]
429 [
Attribute(
"0",
desc:
"When false - there will be used warning text below as default. Otherwise there might be hardcoded strings in format messages.")]
447 [
Attribute(
"-1",
desc:
"Height -1 keep editbox single line. Changing height will override current height")]
480 bool useLabel = !
m_sLabel.IsEmpty();
690 super.SetupHandlers();
697 super.CheckValidity();
716 protected string m_sPositive;
719 protected string m_sNegative;
721 protected SCR_CheckboxComponent m_Checkbox;
726 if (m_ChangeableComponent)
727 m_Checkbox = SCR_CheckboxComponent.Cast(m_ChangeableComponent);
730 m_sClassTag =
"check box";
733 if (!m_sNegative.IsEmpty() && m_Checkbox.m_aSelectionElements[0])
735 SCR_ButtonTextComponent textComp = SCR_ButtonTextComponent.Cast(m_Checkbox.m_aSelectionElements[0]);
740 if (!m_sPositive.IsEmpty() && m_Checkbox.m_aSelectionElements[1])
742 SCR_ButtonTextComponent textComp = SCR_ButtonTextComponent.Cast(m_Checkbox.m_aSelectionElements[1]);
747 m_Checkbox.SetChecked(SCR_JsonApiStructHandler.StringToBool(m_sDefaultValue),
false,
false);
756 bool checked = SCR_JsonApiStructHandler.StringToBool(str);
757 m_Checkbox.SetChecked(checked);
764 return INVALID_VALUE;
766 return m_Checkbox.IsChecked().ToString();
770 SCR_CheckboxComponent GetCheckbox()
796 for (
int i = 0, count =
m_aOptions.Count(); i < count; i++)
875 for (
int i = 0, count =
m_aOptions.Count(); i < count; i++)
888 void GetOptions(out array<ref SCR_LocalizedProperty> options)
890 for (
int i = 0, count =
m_aOptions.Count(); i < count; i++)
910 super.SetupHandlers();
938 protected bool m_bReversed;
943 if (m_ChangeableComponent)
944 m_Selection = SCR_SelectionWidgetComponent.Cast(m_ChangeableComponent);
952 for (
int i = m_aOptions.Count() - 1; i >= 0; i--)
954 m_Selection.
AddItem(m_aOptions[i].m_sLabel);
959 for (
int i = 0, count = m_aOptions.Count(); i < count; i++)
961 m_Selection.
AddItem(m_aOptions[i].m_sLabel);
966 if (!m_sDefaultValue.IsEmpty())
967 SelectOption(m_sDefaultValue.ToInt());
970 m_SpinBox = SCR_SpinBoxComponent.Cast(m_Selection);
981 int value = str.ToInt();
1010 protected string m_sFormatText;
1012 protected SCR_SliderComponent m_Slider;
1017 if (m_ChangeableComponent)
1018 m_Slider = SCR_SliderComponent.Cast(m_ChangeableComponent);
1025 m_Slider.
SetValue(m_sDefaultValue.ToFloat());
1041 return INVALID_VALUE;
1043 return m_Slider.
GetValue().ToString();
1047 void SetRange(
float min,
float max)
ArmaReforgerScripted GetGame()
SCR_BaseEditorAttributeEntryUIInfo m_fMin
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
void SetRange(float range)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_WidgetListEntryEditBox BaseContainerProps
SCR_SpinBoxComponent m_SpinBox
Object holding reference to resource. In destructor release the resource.
void SetText(string text)
Base class for all widgets that can change their internal state as editbox or spinbox.
Variable that is using localized label.
Displays label and value name for variable with localization.
override bool _WB_GetCustomTitle(BaseContainer source, out string title)
void SetFormatText(string text)
void SetValue(float value)
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
void SetCycleMode(bool cycle)
Configurable widget list entry for various value that can be typed - numbers, strings,...
EditBoxFilterComponent m_Filter
SCR_EditBoxComponent m_EditBox
override void SetValue(string str)
override void RemoveWidget()
void OnEditModeLeave(string text)
bool m_bBlacklistIsWhiteList
SCR_EditBoxComponent GetEditBoxComponent()
EJsonApiStructValueType m_iEditType
void OnEditBoxTextChange(string text)
SCR_WidgetEditFormat GetFormatCheck()
string m_sPlaceholderText
void InvokeInvalidInput()
void CheckEditBoxValidity(SCR_EditBoxComponent editBox, string value)
Check if input is right, otherwise show warning.
void SetWarningText(string warning)
override string ValueAsString()
override bool CheckValidity()
ref SCR_WidgetEditFormat m_FormatCheck
SCR_WidgetEditFormatIP m_IPCheck
override bool CheckValidity()
ref array< ref SCR_WidgetListEntry > m_aEntries
Configurable class for widget.
void CreateWidget(Widget parent)
static SCR_ConfigListEntries GetEntriesDefinitions(ResourceName presetsResourceName)
void SetupHandlers()
Empty function to override to assing custom handlers.
void SetLabel(string label)
ResourceName GetEntryLayout()
void SetGroupTag(string tag)
const string INVALID_VALUE
ResourceName m_sEntryLayout
SCR_ChangeableComponentBase m_ChangeableComponent
string ValueAsString()
Return value from widget in string format.
void SetEntryLayout(ResourceName layout)
void SetInteractive(bool interactive)
Can value be interacted - set handler enabled.
EJsonApiStructValueType GetType()
bool CanSkip()
Can skip return true if input is empty and value is not required.
EJsonApiStructValueType m_iType
void SetValue(string str)
void SetPropertyName(string propertyName)
bool CheckValidity()
Default validity for majority of inputs will be true.
const ResourceName ENTRY_DEFINITIONS
void SetVisible(bool show)
override void SetValue(string str)
Apply value to message.
override string ValueAsString()
Return message.
override void CreateWidget(Widget parent)
SCR_SimpleEntryComponent m_SimpleEntry
Configurable widget list entry list selection.
override string ValueAsString()
SCR_SelectionWidgetComponent GetSelectionComponent()
ref array< ref SCR_LocalizedProperty > m_aOptions
int ValueId()
Get selected value as id.
void GetOptions(out array< ref SCR_LocalizedProperty > options)
SCR_LocalizedProperty GetSelectedOption()
Return current selected option as full localized property.
void SetOptions(array< ref SCR_LocalizedProperty > options)
Fill list with options.
SCR_SelectionWidgetComponent m_Selection
Configurable widget list entry selection specific for spinbox.
override void SetValue(string str)
SCR_SpinBoxComponent m_SpinBox
SCR_SpinBoxComponent GetSpinBox()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
SCR_FieldOfViewSettings Attribute