(self, event)
| 210 | self.inputTimer.Start(Fit.getInstance().serviceFittingOptions['marketSearchDelay'], True) |
| 211 | |
| 212 | def OnInputTimer(self, event): |
| 213 | event.Skip() |
| 214 | if self.block: |
| 215 | return |
| 216 | p = self.entityEditor.getActiveEntity() |
| 217 | total = sum([(getattr(self, "%sEdit" % attr).GetValueFloat() or 0) for attr in self.DAMAGE_TYPES]) |
| 218 | for type_ in self.DAMAGE_TYPES: |
| 219 | editBox = getattr(self, "%sEdit" % type_) |
| 220 | percLabel = getattr(self, "%sPerc" % type_) |
| 221 | setattr(p, "%sAmount" % type_, editBox.GetValueFloat() or 0) |
| 222 | percLabel.SetLabel("%.1f%%" % ((editBox.GetValueFloat() or 0) * 100 / total if total > 0 else 0)) |
| 223 | self.totSizer.Layout() |
| 224 | DamagePattern.getInstance().saveChanges(p) |
| 225 | |
| 226 | def restrict(self): |
| 227 | for type_ in self.DAMAGE_TYPES: |
nothing calls this directly
no test coverage detected