From 3524b2cc7fc22d49d0dd73c1c6136399610e12f7 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Fri, 14 Jan 2011 02:03:35 +0300 Subject: [PATCH] Display number of shots instead of number of charges by default --- gui/builtinViewColumns/ammo.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/builtinViewColumns/ammo.py b/gui/builtinViewColumns/ammo.py index 0705699d0..cb3234ccc 100644 --- a/gui/builtinViewColumns/ammo.py +++ b/gui/builtinViewColumns/ammo.py @@ -31,7 +31,16 @@ class Ammo(ViewColumn): self.bitmap = bitmapLoader.getBitmap("damagePattern_small", "icons") def getText(self, stuff): - return "%s (%s)" % (stuff.charge.name, stuff.numCharges) if getattr(stuff, "charge", None) is not None else "" + if getattr(stuff, "charge", None) is not None: + shots = stuff.numShots + if shots > 0: + text = "%s (%s)" % (stuff.charge.name, stuff.numShots) + else: + text = stuff.charge.name + else: + text = "" + + return text def getImageId(self, mod):