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 OnKeyDown(self, key): if 1 == key: self.ExitSelect() if 2 == key: self.SelectSlot(0) if 3 == key: self.SelectSlot(1) if 4 == key: self.SelectSlot(2) if 5 == key: self.SelectSlot(3) if 28 == key: id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID) if 0 == id: self.CreateCharacter() else: self.StartGame() if 203 == key: self.DecreaseSlotIndex() if 205 == key: self.IncreaseSlotIndex() return True
def OnKeyDown(self, key): if 1 == key: self.ExitSelect() for i in xrange(self.SLOT_COUNT): if 2+i == key: self.SelectSlot(i) if 28 == key: id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID) if 0 == id: self.CreateCharacter() else: self.StartGame() if 203 == key: self.slot = (self.GetSlotIndex() - 1 + self.SLOT_COUNT) % self.SLOT_COUNT self.SelectSlot(self.slot) if 205 == key: self.slot = (self.GetSlotIndex() + 1) % self.SLOT_COUNT self.SelectSlot(self.slot) return True
def OnUpdate(self): chr.Update() for i in xrange(4): self.curGauge[i] += (self.destGauge[i] - self.curGauge[i]) / 10.0 if abs(self.curGauge[i] - self.destGauge[i]) < 0.005: self.curGauge[i] = self.destGauge[i] self.GaugeList[i].SetPercentage(self.curGauge[i], 1.0) for i in xrange(self.CHARACTER_TYPE_COUNT): self.curNameAlpha[i] += (self.destNameAlpha[i] - self.curNameAlpha[i]) / 10.0 self.NameList[i].SetAlpha(self.curNameAlpha[i]) for i in xrange(self.SLOT_COUNT): if FALSE == chr.HasInstance(i): continue chr.SelectInstance(i) distance = 50.0 rotRadian = self.curRotation[i] * (math.pi * 2) / 360.0 x = distance * math.sin(rotRadian) + distance * math.cos(rotRadian) y = distance * math.cos(rotRadian) - distance * math.sin(rotRadian) chr.SetPixelPosition(int(x), int(y), 30) ##### dir = app.GetRotatingDirection(self.destRotation[i], self.curRotation[i]) rot = app.GetDegreeDifference(self.destRotation[i], self.curRotation[i]) if app.DEGREE_DIRECTION_RIGHT == dir: self.curRotation[i] += rot / 10.0 elif app.DEGREE_DIRECTION_LEFT == dir: self.curRotation[i] -= rot / 10.0 self.curRotation[i] = (self.curRotation[i] + 360.0) % 360.0 ####################################################### if -1 != self.startIndex: ## Temporary ## BackGroundLoading이 지원 될때까지 임시로.. if app.GetTime() - self.startReservingTime > 3.0: if FALSE == self.openLoadingFlag: chrSlot = self.stream.GetCharacterSlot() net.DirectEnter(chrSlot) self.openLoadingFlag = TRUE playTime = net.GetAccountCharacterSlotDataInteger( self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME) import player player.SetPlayTime(playTime) import chat chat.Clear() ## 들어갈때 Chat 을 초기화. 임시 Pos.
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 OnUpdate(self): chr.Update() for i in xrange(self.SLOT_COUNT): if FALSE == chr.HasInstance(i): continue chr.SelectInstance(i) if -1 != self.startIndex: if app.GetTime() - self.startReservingTime > 3.0: if False == self.openLoadingFlag: chrSlot=self.stream.GetCharacterSlot() net.DirectEnter(chrSlot) self.openLoadingFlag = True player.SetPlayTime(net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME)) chat.Clear() intrologin.set_reg("%s_slot" % constInfo.LastAccount, "%d" % self.stream.GetCharacterSlot())
def AcceptInputPrivateCode(self): privateCode = self.privateInputBoard.GetText() if not privateCode: return pid = net.GetAccountCharacterSlotDataInteger( self.RealSlot[self.SelectSlot], net.ACCOUNT_CHARACTER_SLOT_ID) if not pid: self.PopupMessage(localeInfo.SELECT_EMPTY_SLOT) return net.SendDestroyCharacterPacket(self.RealSlot[self.SelectSlot], privateCode) self.PopupMessage(localeInfo.SELECT_DELEING) self.CancelInputPrivateCode() return True
def OnUpdate(self): chr.Update() self.ToolTipProgress() if self.SelectEmpire: self.SelectEmpire = False self.stream.SetReselectEmpirePhase() self.Hide() if self.MotionStart and app.GetTime() - self.MotionTime >= 2.0: self.MotionStart = False ##기존 사용 그대로 들구옴## #print " Start Game " chrSlot = self.stream.GetCharacterSlot() #print "chrSlot = %s" % chrSlot if musicInfo.selectMusic != "": snd.FadeLimitOutMusic("BGM/" + musicInfo.selectMusic, systemSetting.GetMusicVolume() * 0.05) net.DirectEnter(chrSlot) playTime = net.GetAccountCharacterSlotDataInteger( chrSlot, net.ACCOUNT_CHARACTER_SLOT_PLAYTIME) import player player.SetPlayTime(playTime) import chat chat.Clear() (xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition() event.UpdateEventSet(self.descIndex, xposEventSet + 7, -(yposEventSet + 7)) self.descriptionBox.SetIndex(self.descIndex) for i in xrange(self.LEN_STATPOINT): self.GaugeList[i].SetPercentage(self.curGauge[i], 1.0)
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 __AreAllSlotEmpty(self): for iSlot in xrange(self.SLOT_COUNT): if 0!=net.GetAccountCharacterSlotDataInteger(iSlot, net.ACCOUNT_CHARACTER_SLOT_ID): return 0 return 1
def GetCharacterSlotID(self, slotIndex): return net.GetAccountCharacterSlotDataInteger(slotIndex, net.ACCOUNT_CHARACTER_SLOT_ID)
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