(self, win)
| 68 | return CharacterTextValidor() |
| 69 | |
| 70 | def Validate(self, win): |
| 71 | textCtrl = self.GetWindow() |
| 72 | text = textCtrl.GetValue().strip() |
| 73 | sChar = Character.getInstance() |
| 74 | |
| 75 | try: |
| 76 | if len(text) == 0: |
| 77 | raise ValueError(_t("You must supply a name for the Character!")) |
| 78 | elif text in [x.name for x in sChar.getCharacterList()]: |
| 79 | raise ValueError(_t("Character name already in use, please choose another.")) |
| 80 | |
| 81 | return True |
| 82 | except ValueError as e: |
| 83 | pyfalog.error(e) |
| 84 | wx.MessageBox("{}".format(e), _t("Error")) |
| 85 | textCtrl.SetFocus() |
| 86 | return False |
| 87 | |
| 88 | |
| 89 | class CharacterEntityEditor(EntityEditor): |
nothing calls this directly
no test coverage detected