1037 {
1039
1040 widget =
m_Root.FindAnyWidget(itemWidget);
1041
1042 if (enabled)
1043 {
1044 ProgressBarWidget progressBar;
1045 TextWidget textWidget;
1046 Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
1047 Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
1048
1049
1050 switch (type)
1051 {
1053 progressBar.Show(false);
1054 textWidget.Show(false);
1055 textWidget.GetParent().Show(false);
1056 break;
1058 if (max > 1 || current > 1)
1059 {
1060 string qty_text = string.Format("%1/%2", Math.Round(current).ToString(), max.ToString());
1061 progressBar.Show(false);
1062 textWidget.SetText(qty_text);
1063 textWidget.Show(true);
1064 textWidget.GetParent().Show(true);
1065 }
1066 else
1067 {
1068 progressBar.Show(false);
1069 textWidget.Show(false);
1070 textWidget.GetParent().Show(false);
1071 }
1072 break;
1074 float qty_num = Math.Round((current / max) * 100);
1075
1076 textWidget.Show(false);
1077 progressBar.SetCurrent(qty_num);
1078 progressBar.Show(true);
1079 textWidget.GetParent().Show(true);
1080 break;
1081 }
1082 widget.Show(true);
1083 }
1084 else
1085 widget.Show(false);
1086 }
const int QUANTITY_PROGRESS
const int QUANTITY_HIDDEN