(self, stuff)
| 23 | self.shipImage = fittingView.imageList.GetImageIndex("ship_small", "gui") |
| 24 | |
| 25 | def getImageId(self, stuff): |
| 26 | if isinstance(stuff, BaseWrapper): |
| 27 | stuff = stuff.item |
| 28 | |
| 29 | if isinstance(stuff, Drone): |
| 30 | return -1 |
| 31 | elif isinstance(stuff, Fit): |
| 32 | return self.shipImage |
| 33 | elif isinstance(stuff, Rack): |
| 34 | return -1 |
| 35 | elif isinstance(stuff, Implant): |
| 36 | if stuff.character: # if it has a character as it's parent |
| 37 | return self.fittingView.imageList.GetImageIndex("character_small", "gui") |
| 38 | else: |
| 39 | return self.shipImage |
| 40 | elif isinstance(stuff, Module): |
| 41 | if stuff.isEmpty: |
| 42 | return self.fittingView.imageList.GetImageIndex("slot_%s_small" % FittingSlot(stuff.slot).name.lower(), |
| 43 | "gui") |
| 44 | else: |
| 45 | return self.loadIconFile(stuff.item.iconID or "") |
| 46 | elif isinstance(stuff, TargetProfile): |
| 47 | return self.fittingView.imageList.GetImageIndex("target_small", "gui") |
| 48 | |
| 49 | item = getattr(stuff, "item", stuff) |
| 50 | return self.loadIconFile(item.iconID) |
| 51 | |
| 52 | def loadIconFile(self, iconFile): |
| 53 | if iconFile: |
nothing calls this directly
no test coverage detected