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

◆ SetItemQuantity()

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

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

1073 {
1074 Widget widget;
1075
1076 widget = m_Root.FindAnyWidget(itemWidget);
1077
1078 if (enabled)
1079 {
1080 ProgressBarWidget progressBar;
1081 TextWidget textWidget;
1082 Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
1083 Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
1084
1085 //check for volume vs. count and display progressbar or "bubble" with exact count/max text
1086 switch (type)
1087 {
1088 case QUANTITY_HIDDEN :
1089 progressBar.Show(false);
1090 textWidget.Show(false);
1091 textWidget.GetParent().Show(false);
1092 break;
1093 case QUANTITY_COUNT :
1094 if (max > 1 || current > 1)
1095 {
1096 string qty_text = string.Format("%1/%2", Math.Round(current).ToString(), max.ToString());
1097 progressBar.Show(false);
1098 textWidget.SetText(qty_text);
1099 textWidget.Show(true);
1100 textWidget.GetParent().Show(true);
1101 }
1102 else
1103 {
1104 progressBar.Show(false);
1105 textWidget.Show(false);
1106 textWidget.GetParent().Show(false);
1107 }
1108 break;
1109 case QUANTITY_PROGRESS :
1110 float qty_num = Math.Round((current / max) * 100);
1111
1112 textWidget.Show(false);
1113 progressBar.SetCurrent(qty_num);
1114 progressBar.Show(true);
1115 textWidget.GetParent().Show(true);
1116 break;
1117 }
1118 widget.Show(true);
1119 }
1120 else
1121 widget.Show(false);
Widget m_Root
Определения ActionTargetsCursor.c:85
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().

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