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