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

◆ SetItemQuantity()

void ScriptedWidgetEventHandler::SetItemQuantity ( int type,
float current,
int min,
int max,
string itemWidget,
string quantityPBWidget,
string quantityTextWidget,
bool enabled )
inlineprotected

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

425 {
426 Widget widget;
427
428 widget = m_Root.FindAnyWidget(itemWidget);
429
430 if (enabled)
431 {
432 ProgressBarWidget progressBar;
433 TextWidget textWidget;
434 Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
435 Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
436
437 //check for volume vs. count and display progressbar or "bubble" with exact count/max text
438 switch (type)
439 {
440 case QUANTITY_HIDDEN :
441 progressBar.Show(false);
442 textWidget.Show(false);
443 textWidget.GetParent().Show(false);
444 break;
445 case QUANTITY_COUNT :
446 if (max > 1 || current > 1)
447 {
448 string qty_text = string.Format("%1/%2", Math.Round(current).ToString(), max.ToString());
449 progressBar.Show(false);
450 textWidget.SetText(qty_text);
451 textWidget.Show(true);
452 textWidget.GetParent().Show(true);
453 break;
454 }
455 else
456 {
457 progressBar.Show(false);
458 textWidget.Show(false);
459 textWidget.GetParent().Show(false);
460 break;
461 }
462 case QUANTITY_PROGRESS :
463 textWidget.Show(false);
464 progressBar.SetCurrent(current);
465 progressBar.Show(true);
466 textWidget.GetParent().Show(true);
467 break;
468 }
469 widget.Show(true);
470 }
471 else
472 widget.Show(false);
473 }
Widget m_Root
Определения SizeToChild.c:9
const int QUANTITY_PROGRESS
Определения constants.c:516
const int QUANTITY_COUNT
Определения constants.c:515
const int QUANTITY_HIDDEN
Определения constants.c:514
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки Class::CastTo(), m_Root, QUANTITY_COUNT, QUANTITY_HIDDEN, QUANTITY_PROGRESS, Math::Round() и float::ToString().

Используется в BuildCursor().