def Refresh(self): if not self.isLoad: return indexArray = (3, 2, 1, 0) for index in indexArray: id = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_ID) race = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_RACE) form = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_FORM) name = net.GetAccountCharacterSlotDataString( index, net.ACCOUNT_CHARACTER_SLOT_NAME) hair = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_HAIR) acce = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_ACCE) if id: self.MakeCharacter(index, id, name, race, form, hair) self.SelectSlot(index) try: self.SelectSlot( int(intrologin.get_reg("%s_slot" % constInfo.LastAccount))) except: self.SelectSlot(self.slot)
def Refresh(self): if not self.isLoad: return # SLOT4 indexArray = (3, 2, 1, 0) for index in indexArray: id = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_ID) race = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_RACE) form = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_FORM) name = net.GetAccountCharacterSlotDataString( index, net.ACCOUNT_CHARACTER_SLOT_NAME) hair = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_HAIR) sash = 0 if app.ENABLE_SASH_SYSTEM: sash = net.GetAccountCharacterSlotDataInteger( index, net.ACCOUNT_CHARACTER_SLOT_SASH) if id: self.MakeCharacter(index, id, name, race, form, hair, sash) self.SelectSlot(index) self.SelectSlot(self.slot)
def SelectSlot(self, index): if index < 0: return if index >= self.SLOT_COUNT: return self.slot = index for i in range(self.SLOT_COUNT): chr.DeleteInstance(i) chr.SelectInstance(self.slot) id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID) if 0 != id: self.btnStart.Enable() self.btnDelete.Show() self.btnCreate.Hide() name = net.GetAccountCharacterSlotDataString(self.slot, net.ACCOUNT_CHARACTER_SLOT_NAME) level = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_LEVEL) playTime = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME) hth = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_HTH) int = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_INT) str = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_STR) dex = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_DEX) race = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_RACE) form = net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_FORM) hair = net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_HAIR) self.changeNameFlag = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG) self.MakeCharacter(self.slot, id, name, race, form, hair) self.charName.SetText("%s" % name) self.empireName.SetText("Imperiul %s" % {1:"Shinsoo", 2:"Chunjo", 3:"Jinno"}.get(net.GetEmpireID(), "None")) if net.GetAccountCharacterSlotDataString(self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_NAME): self.guildName.SetText(net.GetAccountCharacterSlotDataString(self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_NAME)) else: self.guildName.SetText(localeInfo.SELECT_NOT_JOIN_GUILD) self.level.SetText("%d" % level) self.playTime.SetText("%d" % playTime) else: self.InitCharacterBoard()
def Refresh(self): if not self.isLoad: return # SLOT4 indexArray = range(self.SLOT_COUNT-1, -1, -1) for index in indexArray: id=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_ID) race=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_RACE) form=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_FORM) name=net.GetAccountCharacterSlotDataString(index, net.ACCOUNT_CHARACTER_SLOT_NAME) hair=net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_HAIR) if app.ENABLE_ACCE_SYSTEM: acce = net.GetAccountCharacterSlotDataInteger(index, net.ACCOUNT_CHARACTER_SLOT_ACCE) if id: if app.ENABLE_ACCE_SYSTEM: self.MakeCharacter(index, id, name, race, form, hair, acce) else: self.MakeCharacter(index, id, name, race, form, hair) self.SelectSlot(index) self.SelectSlot(self.slot)
def SelectSlot(self, index): if index < 0: return if index >= self.SLOT_COUNT: return self.slot = index chr.SelectInstance(self.slot) for i in xrange(self.CHARACTER_TYPE_COUNT): self.destNameAlpha[i] = 0.0 for i in xrange(self.SLOT_COUNT): self.destRotation[(i + self.slot) % self.SLOT_COUNT] = self.SLOT_ROTATION[i] self.destGauge = [0.0, 0.0, 0.0, 0.0] id = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_ID) if 0 != id: self.btnStart.Show() self.btnDelete.Show() self.btnCreate.Hide() playTime = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME) level = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_LEVEL) race = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_RACE) valueHTH = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_HTH) valueINT = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_INT) valueSTR = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_STR) valueDEX = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_DEX) name = net.GetAccountCharacterSlotDataString( self.slot, net.ACCOUNT_CHARACTER_SLOT_NAME) guildID = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_ID) guildName = net.GetAccountCharacterSlotDataString( self.slot, net.ACCOUNT_CHARACTER_SLOT_GUILD_NAME) self.changeNameFlag = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG) job = chr.RaceToJob(race) if job >= 0 and job < self.CHARACTER_TYPE_COUNT: self.destNameAlpha[job] = 1.0 self.CharacterName.SetText(name) self.CharacterLevel.SetText(str(level)) self.PlayTime.SetText(str(playTime)) self.CharacterHTH.SetText(str(valueHTH)) self.CharacterINT.SetText(str(valueINT)) self.CharacterSTR.SetText(str(valueSTR)) self.CharacterDEX.SetText(str(valueDEX)) if guildName: self.GuildName.SetText(guildName) else: self.GuildName.SetText(localeInfo.SELECT_NOT_JOIN_GUILD) statesSummary = float(valueHTH + valueINT + valueSTR + valueDEX) if statesSummary > 0.0: self.destGauge = [ float(valueHTH) / statesSummary, float(valueINT) / statesSummary, float(valueSTR) / statesSummary, float(valueDEX) / statesSummary ] else: self.InitCharacterBoard()
def LoadCharacterData(self): self.RefreshData() self.MainStream.All_ButtonInfoHide() for i in xrange(net.CHARACTER_SLOT_COUNT_MAX): pid = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_ID) if not pid: self.EmptySlot.append(i) continue name = net.GetAccountCharacterSlotDataString( i, net.ACCOUNT_CHARACTER_SLOT_NAME) level = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_LEVEL) race = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_RACE) playtime = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME) guildname = net.GetAccountCharacterSlotDataString( i, net.ACCOUNT_CHARACTER_SLOT_GUILD_NAME) form = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_FORM) hair = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_HAIR) stat_str = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_STR) stat_dex = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_DEX) stat_hth = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_HTH) stat_int = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_INT) last_playtime = 0 #net.GetAccountCharacterSlotDataInteger(i, net.ACCOUNT_CHARACTER_SLOT_LAST_PLAYTIME) change_name = net.GetAccountCharacterSlotDataInteger( i, net.ACCOUNT_CHARACTER_SLOT_CHANGE_NAME_FLAG) acce = 0 #net.GetAccountCharacterSlotDataInteger(i, net.ACCOUNT_CHARACTER_SLOT_ACCE) self.SetPriorityData(last_playtime, i) self.myUnitDic[i] = self.MyUnit(i, name, level, race, playtime, guildname, form, hair, acce, stat_str, stat_dex, stat_hth, stat_int, change_name) self.PriorityData.sort(reverse=True) for i in xrange(len(self.PriorityData)): time, index = self.PriorityData[i] DestDataDic = self.myUnitDic[index].GetUnitData() self.SetSortingData(i, DestDataDic["RACE"], DestDataDic["GUILDNAME"], DestDataDic["PLAYTIME"], DestDataDic["STR"], DestDataDic["DEX"], DestDataDic["HTH"], DestDataDic["INT"], DestDataDic["CHANGENAME"]) self.MakeCharacter(i, DestDataDic["NAME"], DestDataDic["RACE"], DestDataDic["FORM"], DestDataDic["HAIR"], DestDataDic["ACCE"]) self.MainStream.InitDataSet(i, DestDataDic["NAME"], DestDataDic["LEVEL"], DestDataDic["ID"]) ## Default Setting ## if self.HowManyChar: self.MainStream.SelectButton(0) return self.HowManyChar