1506 {
1507 Weapon_Base wpn = Weapon_Base.Cast(
m_Obj);
1508 if (wpn)
1509 {
1512 float posX = 0.0;
1513 float width = 0.0, height = 0.0;
1514 for (int i = 0; i < wpn.GetMuzzleCount(); i++)
1515 {
1516 if (i == 1)
1517 {
1519 }
1520 posX += width;
1521
1522 Widget ammoIcon =
Widget.Cast(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/inventory_new/ammo_icon.layout", GetMainWidget()));
1523 ammoIcon.SetPos(posX, 0.0, false);
1524
1525 ImageWidget ammoIconImg = ImageWidget.Cast(ammoIcon.GetChildren());
1526
1527 AmmoData data = Magazine.GetAmmoData(wpn.GetChamberAmmoTypeName(i));
1528 if (data)
1529 {
1531 switch (cartridgeType)
1532 {
1534 {
1535 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_pistol");
1536 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_pistol");
1537 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_pistol");
1538 break;
1539 }
1541 {
1542 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_int");
1543 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_int");
1544 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_int");
1545 break;
1546 }
1548 {
1549 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_fp");
1550 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_fp");
1551 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_fp");
1552 break;
1553 }
1555 {
1556 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_shell");
1557 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_shell");
1558 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_shell");
1559 break;
1560 }
1561
1563 {
1564 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:arrow_int");
1565 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:arrow_int");
1566 break;
1567 }
1568 }
1569 }
1571 }
1572 }
1573 else
1574 {
1576 }
1577 }
ref array< ImageWidget > m_AmmoIcons
proto native CGame GetGame()