Nachdem ich eingefügt habe, dass Login Daten gespeichert werden, funktionierte in der Charakterauswahl, das auswählen über die Pfeiltasten und Enter nicht mehr. Weiß jemand worin das Problem liegen könnte?
Code: Ausschnitt aus der intrologin.py
- if self.idEditLine == None:
- self.idEditLine.SetText("")
- if self.pwdEditLine == None:
- self.pwdEditLine.SetText("")
- self.idEditLine.SetFocus()
- global SKIP_LOGIN_PHASE
- if SKIP_LOGIN_PHASE:
- if not self.loginInfo:
- self.connectBoard.Hide()
- self.accountBoard.Hide()
- def __OnSelectRegionGroup(self):
- self.__RefreshServerList()
Code: Ausschnitt aus der intrologin.py
- def __LoadAccountNames(self):
- for itemx in os.listdir(settingsFolder):
- filedata = open(settingsFolder+itemx)
- logindata = filedata.readline().replace( "\n", "" )
- filedata.close()
- if logindata!="":
- slot = [int(s) for s in list(itemx) if s.isdigit()][0]
- self.accountLabelList[slot-1].SetText(logindata)
- if not self.toEditValue:
- self.accountButtonList[slot-1].SetEvent(self.__LoadACCInfos, slot)
- def accountEditButtonEvent(self):
- if self.toEditValue:
- self.toEditValue = 0
- else:
- self.toEditValue = 1
- for itemx in os.listdir(settingsFolder):
- filedata = open(settingsFolder+itemx)
- logindata = filedata.readline().replace( "\n", "" )
- filedata.close()
- if logindata != "":
- slot = [int(s) for s in list(itemx) if s.isdigit()][0]
- if not self.toEditValue:
- self.accountButtonList[slot-1].SetText(uiScriptLocale.LOGIN_SELECT_BUTTON)
- self.accountButtonList[slot-1].SetEvent(self.__LoadACCInfos, slot)
- else:
- self.accountButtonList[slot-1].SetText(uiScriptLocale.SELECT_DELETE)
- self.accountButtonList[slot-1].SetEvent(self.accountDeleteData, slot)
- self.__LoadAccountNames()
- def __LoadACCInfos(self, accid):
- import linecache
- login = linecache.getline(settingsFolder+"loginsetting" + str(accid) + ".cfg", 1).replace('\n', '')
- password = linecache.getline(settingsFolder+"loginsetting" + str(accid) + ".cfg", 2)
- self.Connect(login, password)
- def accountDeleteData(self, slot):
- os.remove(settingsFolder+"loginsetting"+str(slot)+".cfg")
- open(settingsFolder+"loginsetting"+str(slot)+".cfg", 'a').close()
- self.accountButtonList[slot-1].SetText(uiScriptLocale.LOGIN_SELECT_BUTTON)
- self.accountLabelList[slot-1].SetText("ACC"+str(slot)+" - Leer")
- self.__LoadAccountNames()
- def __SaveAccountData(self):
- id = self.idEditLine.GetText()
- pwd = self.pwdEditLine.GetText()
- for x in xrange(1,5):
- if not os.path.exists(settingsFolder+"loginsetting"+str(x)+".cfg"):
- open(settingsFolder+"loginsetting"+str(x)+".cfg", 'a').close()
- slot = 0
- for itemx in os.listdir(settingsFolder):
- filedata = open(settingsFolder+itemx)
- logindata = filedata.readline().replace( "\n", "" )
- filedata.close()
- if logindata=="":
- slot = [int(s) for s in list(itemx) if s.isdigit()][0]
- break
- if not slot:
- self.PopupNotifyMessage("Es ist kein Slot zum speichern frei!")
- else:
- f = open(settingsFolder+"loginsetting"+str(slot)+".cfg", "w")
- f.write (id +"\n")
- f.write (pwd)
- f.close()
- self.PopupNotifyMessage("Deine Login-Daten wurden gespeichert!")
- self.__LoadAccountNames()