DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetQuantity()

override void SetQuantity ( )
protected

См. определение в файле ConstructionInfoIcons.c строка 298

299 {
300 if (m_Item)
301 {
302 //m_QuantityItem.SetAlpha(1.0);
303 int quantityType = QuantityConversions.HasItemQuantity(m_Item);
304 if (quantityType != QUANTITY_HIDDEN && m_CurrQuantity != QuantityConversions.GetItemQuantity(m_Item))
305 {
306 float requiredQty;
307 float lastQuantity = m_CurrQuantity;
309 if (lastQuantity == m_CurrQuantity) //skip except quantity changed
310 return;
311
312 string color1, color2;
313
314 if (quantityType == QUANTITY_COUNT)
315 {
316 requiredQty = GetContextualSlotMax();
317 bool sufficient = m_CurrQuantity >= requiredQty;
318 if (m_LastSufficientMaterialState != sufficient)
319 {
320 m_ColWidget.Show(sufficient);
321 m_ItemPreview.Show(sufficient);
322 m_GhostSlot.Show(!sufficient);
323
324 if (!sufficient)
325 {
328
329 string iconPath = m_Item.GetInventoryItemType().GetGhostIconImagepath();
330 if (iconPath != "")
331 {
332 m_GhostSlot.LoadImageFile(1, iconPath, false);
333 m_GhostSlot.SetImage(1);
334 m_GhostSlot.SetColor(0xFFFFFFFF);
335 }
336 }
337 else
338 {
339 color1 = COLOR_WHITE.ToString();
340 color2 = COLOR_WHITE.ToString();
341 }
342
343 m_QuantityStack.Show(requiredQty != 1);
344 m_QuantityProgress.Show(false);
346
347 RichTextWidget.Cast(m_QuantityItem).SetText(string.Format("<color hex=\"%1\">%2</color><color hex=\"%3\">/%4</color>", color1, m_CurrQuantity.ToString(), color2, requiredQty.ToString()));
348 }
349 }
350 /*else if (quantityType == QUANTITY_PROGRESS)
351 {
352 requiredQty = GetContextualSlotMax();
353
354 float value = Math.Round((m_CurrQuantity / requiredQty) * 100);
355 m_QuantityProgress.SetCurrent(value);
356 m_QuantityStack.Show(false);
357 m_QuantityProgress.Show(true);
358 }*/
359 }
360 }
361 }
ItemBase m_Item
Определения ActionInput.c:16
const string QUANTITY_TEXT_COLOR_LIGHTER_ARGB
Определения ConstructionInfoIcons.c:164
int GetContextualSlotMax()
Определения ConstructionInfoIcons.c:388
int m_LastSufficientMaterialState
Определения ConstructionInfoIcons.c:166
ConstructionToolInfoIcon QUANTITY_TEXT_COLOR_DARKER_ARGB
static float GetItemQuantity(InventoryItem item)
Определения QuantityConversions.c:72
static int HasItemQuantity(notnull EntityAI item)
Определения QuantityConversions.c:143
Определения gameplay.c:317
proto string ToString(bool simple=true)
const int COLOR_WHITE
Определения 1_Core/DayZ/constants.c:63
const int QUANTITY_COUNT
Определения 3_Game/DayZ/constants.c:554
const int QUANTITY_HIDDEN
Определения 3_Game/DayZ/constants.c:553

Перекрестные ссылки COLOR_WHITE, GetContextualSlotMax(), QuantityConversions::GetItemQuantity(), QuantityConversions::HasItemQuantity(), m_Item, m_LastSufficientMaterialState, QUANTITY_COUNT, QUANTITY_HIDDEN, QUANTITY_TEXT_COLOR_DARKER_ARGB, QUANTITY_TEXT_COLOR_LIGHTER_ARGB, float::ToString() и string::ToString().

Используется в AddQuantity(), AfterStoreLoad(), CalcAndSetQuantity(), Capture(), DeSerializeNumericalVars(), GasMask_Filter::EEHealthLevelChanged(), MaskBase::EEHealthLevelChanged(), Apple::EEOnCECreate(), Figs::EEOnCECreate(), GreenBellPepper::EEOnCECreate(), Pear::EEOnCECreate(), Plum::EEOnCECreate(), Potato::EEOnCECreate(), Tomato::EEOnCECreate(), Zucchini::EEOnCECreate(), OnAction(), ReadVarsFromCTX(), Release(), SetQuantityMax(), SetQuantityNormalized(), SetQuantityToMinimum(), SplitIntoStackMax() и SplitIntoStackMaxEx().