Example #1
0
    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.
Example #2
0
	def OnUpdate(self):
		chr.Update()

		(xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
		event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
		self.descriptionBox.SetIndex(self.descIndex)

		for i in xrange(SLOT_COUNT[self.gender]):
			self.curNameAlpha[i] += (self.destNameAlpha[i] - self.curNameAlpha[i]) / 10.0
			self.NameList[self.gender][i].SetAlpha(self.curNameAlpha[i])

		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 page in xrange(PAGE_COUNT):
			for i in xrange(SLOT_COUNT[page]):
				chr.SelectInstance(self.__GetSlotChrID(page, 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)

				if abs(self.destRotation[i] - self.curRotation[i]) < 1.0:
					self.curRotation[i] = self.destRotation[i]

				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.reservingRaceIndex:
			if app.GetTime() - self.reservingStartTime >= 1.5:

				chrSlot=self.stream.GetCharacterSlot()
				textName = self.editCharacterName.GetText()
				raceIndex = self.reservingRaceIndex
				shapeIndex = self.reservingShapeIndex

				startStat = self.START_STAT[self.reservingRaceIndex]
				statCon = self.stat[0] - startStat[0]
				statInt = self.stat[1] - startStat[1]
				statStr = self.stat[2] - startStat[2]
				statDex = self.stat[3] - startStat[3]

				net.SendCreateCharacterPacket(chrSlot, textName, raceIndex, shapeIndex, statCon, statInt, statStr, statDex)

				self.reservingRaceIndex = -1