40 super.Init(w, attribute);
47 Print(
"SCR_DateAttributeUIComponent could not find GetTimeAndWeatherManager!",
LogLevel.ERROR);
53 if (!dateHolderWidget)
return;
56 if (!dateHolder)
return;
63 if (!labelHolder0 || !labelHolder1 || !labelHolder2)
return;
75 if (!comboBoxWidget0 || !comboBoxWidget1 || !comboBoxWidget2)
return;
87 array<ref SCR_BaseEditorAttributeEntry> entries =
new array<ref SCR_BaseEditorAttributeEntry>;
88 int entriesCount = attribute.
GetEntries(entries);
89 string dayLabel, monthLabel, yearLabel;
94 if (!stringData)
return;
95 dateHolder.SetLabel(stringData.GetText());
98 if (!stringData)
return;
102 if (!stringData)
return;
103 dayLabel = stringData.GetText();
106 if (!stringData)
return;
107 monthLabel = stringData.GetText();
110 if (!stringData)
return;
111 yearLabel = stringData.GetText();
150 super.SetFromVar(var);
157 int currentDateIndex = comboBox.GetCurrentIndex();
161 if (count == 0)
return;
165 if (!timeManager)
return;
168 int day, month, year;
182 for (
int i = 0; i < count; i++)
191 icon = moonPhaseInfo.GetIconPath();
203 while (currentDateIndex >= comboBox.GetNumItems() && currentDateIndex > 0){
207 comboBox.SetCurrentItem(currentDateIndex);
217 int day, month, year;
226 moonPhaseInfo.SetIconTo(icon);
228 icon.SetVisible(
true);
240 daytime = dayTimeVar.
GetFloat() / 3600;
251 for (
int i = 0; i < count; i++)
262 for (
int i = 0; i < count; i++)
305 if (!attribute)
return false;
312 super.OnChangeInternal(w, x, y, finished);
330 super.OnMouseEnter(w, x, y);
338 super.HandlerDeattached(w);
void SCR_EditorAttributeEntryStringArray(array< ref LocalizedString > values)
void SCR_BaseEditorAttributeEntryText(string text)
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
sealed SCR_BaseEditorAttributeVar GetVariable(bool createWhenNull=false)
sealed SCR_BaseEditorAttributeVar GetVariableOrCopy()
int GetEntries(notnull array< ref SCR_BaseEditorAttributeEntry > outEntries)
Get attribute this component represents return Editor attribute *SCR_BaseEditorAttribute GetAttribute()
SCR_AttributesManagerEditorComponent m_AttributeManager
string m_sUiComponentName
void SetVector(vector value)
ImageWidget GetIconWidget()
override int AddItem(string item, bool last=false, Managed data=null)
int AddItemAndIcon(string item, ResourceName icon, float rotation=0, Managed data=null)
override void HandlerDeattached(Widget w)
SCR_ComboBoxIconComponent m_comboBox1
TimeAndWeatherManagerEntity m_TimeAndWeatherManager
SCR_ComboBoxIconComponent GetCorrectComboBox(string lookfor)
GetGame().GetWorkspace().SetFocusedWidget(m_comboBox0.GetRootWidget())
void FillYearComboBox(SCR_ComboBoxIconComponent comboBox)
void SetMonthWidgetFillWeight()
SCR_ComboBoxIconComponent m_comboBox2
SCR_ComboBoxIconComponent m_comboBox0
override void SetFromVar(SCR_BaseEditorAttributeVar var)
void UpdateDateMoonPhaseIcon()
void SetDateComboBoxes(vector date)
ref SCR_EditorAttributeEntryStringArray m_aMonthData
void OnComboBoxChanged(SCR_ComboBoxComponent comboBox, int index)
TextWidget GetCorrectLabel(string lookfor)
void GetCorrectDateTime(out float daytime, out int day, out int month, out int year)
void CreateDayList(SCR_ComboBoxIconComponent comboBox, int currentMonth, int currentYear, bool setMoonIcon=true)
void FillMonthComboBox(SCR_ComboBoxIconComponent comboBox)
override void Init(Widget w, SCR_BaseEditorAttribute attribute)
ref SCR_EditorAttributeEntryIntArray m_aYearData
string m_sLabelHolderBaseName
ref array< int > m_aDayArray
override bool OnChangeInternal(Widget w, int x, int y, bool finished)
float GetMoonphaseImageRotation()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
RespawnSystemComponentClass GameComponentClass vector vector rotation
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
proto native vector Vector(float x, float y, float z)