本文整理汇总了Python中uthread.new函数的典型用法代码示例。如果您正苦于以下问题:Python new函数的具体用法?Python new怎么用?Python new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了new函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: RandomizeCharacter
def RandomizeCharacter(self, randomizingPart = None, *args):
info = self.GetInfo()
doll = self.charSvc.GetSingleCharactersDoll(info.charID)
if doll.busyUpdating:
return
uicore.layer.charactercreation.LockNavigation()
uicore.layer.charactercreation.ToggleClothes(forcedValue=0)
uthread.new(self.RandomizeRotation_thread, self.sr.randomButton)
itemList = []
if info.genderID == ccConst.GENDERID_FEMALE:
itemList = ccConst.femaleRandomizeItems.keys()
else:
itemList = ccConst.maleRandomizeItems.keys()
canChangeBaseAppearance = uicore.layer.charactercreation.CanChangeBaseAppearance()
blacklist = ccConst.randomizerCategoryBlacklist[:]
if not canChangeBaseAppearance:
blacklist += ccConst.recustomizationRandomizerBlacklist
if info.genderID == ccConst.GENDERID_FEMALE:
blacklist.append(ccConst.scarring)
categoryList = []
for item in itemList:
if item not in blacklist:
categoryList.append(item)
self.charSvc.RandomizeCharacterGroups(info.charID, categoryList, doUpdate=False, fullRandomization=True)
if canChangeBaseAppearance:
self.charSvc.RandomizeCharacterSculpting(info.charID, doUpdate=False)
decalModifiers = doll.buildDataManager.GetModifiersByCategory(ccConst.tattoo)
for modifier in decalModifiers:
modifier.IsDirty = True
self.charSvc.UpdateDoll(info.charID, 'RandomizeCharacter')
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:32,代码来源:characterCustomization.py
示例2: AddExplosion
def AddExplosion(self, uniqueName, explosionGfxID, spreadOut):
if uniqueName not in self.districts:
self.LogError('Could not find district ' + str(uniqueName) + ' for planet with id ' + str(self.itemID))
graphics = cfg.graphics.GetIfExists(explosionGfxID)
if graphics is None:
self.LogError('Explosion graphicsID ' + str(explosionGfxID) + " doesn't exist!")
return
fx = trinity.Load(graphics.graphicFile)
if fx is None:
self.LogError('Explosion ' + str(graphics.graphicFile) + " doesn't exist!")
return
if len(fx.curveSets) == 0:
self.LogError('Explosion ' + str(graphics.graphicFile) + ' has no curveSets! This is useless...')
return
direction = self.districts[uniqueName].centerNormal
rotMatrix1 = geo2.MatrixRotationAxis((direction[1], direction[2], direction[0]), random.random() * spreadOut * self.districts[uniqueName].pinRadius)
rotMatrix2 = geo2.MatrixRotationAxis(direction, random.uniform(0, 2.0 * math.pi))
direction = geo2.Vec3TransformNormal(direction, rotMatrix1)
direction = geo2.Vec3TransformNormal(direction, rotMatrix2)
fx.translation = direction
fx.scaling = (5000.0 / PLANET_SIZE_SCALE, 5000.0 / PLANET_SIZE_SCALE, 5000.0 / PLANET_SIZE_SCALE)
v1 = geo2.Vec3Cross(geo2.Vec3Normalize(direction), (0.0, 1.0, 0.0))
alpha = -math.acos(geo2.Vec3Dot(geo2.Vec3Normalize(direction), (0.0, 1.0, 0.0)))
fx.rotation = geo2.QuaternionRotationAxis(v1, alpha)
duration = fx.curveSets[0].GetMaxCurveDuration()
self.districtExplosions.children.append(fx)
uthread.new(self._RemoveExplosionFromDistrict, fx, duration)
开发者ID:Pluckyduck,项目名称:eve,代码行数:27,代码来源:planet.py
示例3: ApplyAttributes
def ApplyAttributes(self, attributes):
uicls.Transform.ApplyAttributes(self, attributes)
sprite = uicls.Sprite(parent=self, texturePath='res:/UI/Texture/loadingWheel.dds', pos=(0, 0, 0, 0), align=uiconst.TOALL, state=uiconst.UI_DISABLED)
loopParams = attributes.get('loopParams', self.default_loopParams)
if loopParams:
direction, time = loopParams
uthread.new(self.StartRotationCycle, direction, time)
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:eveLoadingWheel.py
示例4: LogColorModeUsage
def LogColorModeUsage(useCase = ''):
colorMode = settings.char.ui.Get('%s_%s' % (VIEWMODE_COLOR_SETTINGS, mapViewConst.MAPVIEW_PRIMARY_ID), mapViewConst.DEFAULT_MAPVIEW_SETTINGS[VIEWMODE_COLOR_SETTINGS])
if isinstance(colorMode, tuple):
colorMode, _colorModeArgs = colorMode
if colorMode in colorModeLogName:
logValue = '%s (%s)' % (colorModeLogName[colorMode], useCase)
uthread.new(sm.GetService('experimentClientSvc').LogMapColorModeLoadedCounter, logValue)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:mapViewUtil.py
示例5: Damage
def Damage(self, items, *args):
btnSetup = {self.sr.selBtn: uiconst.UI_HIDDEN,
self.sr.pickBtn: uiconst.UI_DISABLED}
temp = uix.QtyPopup(100, 1, 50, hint=localization.GetByLabel('UI/Station/Repair/ApplyDamage'))
percentage = temp and temp['qty']
if percentage == 0 or percentage is None:
self.sr.pickBtn.state = uiconst.UI_NORMAL
return
itemIDAndAmountOfDamageList = []
try:
for item in items:
if self.invCache.IsItemLocked(item.itemID):
continue
if not self.invCache.TryLockItem(item.itemID, 'lockRepairingItem', {}, 1):
continue
amount = int(math.ceil(float(percentage) / 100.0 * float(item.maxHealth - item.damage)))
itemIDAndAmountOfDamageList.append((item.itemID, amount))
if len(itemIDAndAmountOfDamageList):
self.repairSvc.DamageModules(itemIDAndAmountOfDamageList)
finally:
for itemID, amount in itemIDAndAmountOfDamageList:
self.invCache.UnlockItem(itemID)
uthread.new(self.DisplayRepairQuote, self.GetAll())
btnSetup[self.sr.pickBtn] = uiconst.UI_NORMAL
self.DisplayButtons(btnSetup)
开发者ID:Pluckyduck,项目名称:eve,代码行数:28,代码来源:base_repairshop.py
示例6: OnFleetJoin_Local
def OnFleetJoin_Local(self, memberInfo, state = 'Active'):
if self.destroyed:
return
myID = util.GetAttrs(self, 'sr', 'node', 'charID')
charID = memberInfo.charID
if myID is not None and charID == myID:
uthread.new(self.SetRelationship, self.sr.node)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:userentry.py
示例7: StartScale
def StartScale(self, sender, btn, *args):
if self.align == uiconst.TOALL:
return
self.scaleData = (self.left,
self.top,
self.width,
self.height)
scalerName = sender.name
if 'Left' in scalerName and self.align != uiconst.TOLEFT:
modX = -1
elif 'Right' in scalerName and self.align != uiconst.TORIGHT:
modX = 1
else:
modX = 0
if 'Top' in scalerName:
modY = -1
elif 'Bottom' in scalerName:
modY = 1
else:
modY = 0
if not (modX or modY):
return
self.scaleModifiers = (modX, modY)
self._scaling = True
uthread.new(self.OnScale, uicore.uilib.x, uicore.uilib.y)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:25,代码来源:dockPanel.py
示例8: ProcessEntityVisibility
def ProcessEntityVisibility(self, eventList):
charid = session.charid
playerEntityCreateIdx = None
charactersCreated = []
for i, event in enumerate(eventList):
if event[0] == 'OnEntityCreate' and event[2] == charid:
eventList[i] = eventList[0]
eventList[0] = event
break
callsToMake = []
for t in eventList:
if t[0] == 'OnEntityCreate':
eventName, sceneID, entityID, initialState = t
callsToMake.append((self._CreateEntity, (sceneID, entityID, initialState)))
if util.IsCharacter(entityID):
charactersCreated.append(entityID)
elif t[0] == 'OnEntityDestroy':
eventName, entityID = t
callsToMake.append((self._RemoveEntity, (entityID,)))
else:
self.LogError('Aperture Client received a unknown event type %s', str(t[0]))
if charactersCreated:
uthread.new(cfg.eveowners.Prime, charactersCreated)
uthread.parallel(callsToMake)
开发者ID:Pluckyduck,项目名称:eve,代码行数:26,代码来源:apertureClient.py
示例9: UpdateSessionTimer
def UpdateSessionTimer(self):
if settings.user.ui.Get('showSessionTimer', 0):
if self.sessionTimer:
uthread.new(self.sessionTimer.AnimSessionChange)
self.sessionTimerUpdatePending = False
else:
self.sessionTimerUpdatePending = True
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:infoPanelSvc.py
示例10: GetDamageStateForDrone
def GetDamageStateForDrone(self, droneID):
if self.IsDroneDamageReady(droneID):
return self.droneDamageStatesByDroneIDs.get(droneID, None)
droneIDsMissingDamage = self.FindDronesMissingDamageState([droneID])
if droneIDsMissingDamage:
uthread.new(self.FetchInBayDroneDamageToServer, droneIDsMissingDamage)
return -1
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:droneHandler.py
示例11: Run
def Run(self, memStream = None):
self.LogInfo('Starting War')
self.state = SERVICE_START_PENDING
self.__warMoniker = None
self.__warMonikerOwnerID = None
items = warObject.__dict__.items()
for objectName in self.__functionalobjects__:
if objectName == 'base':
continue
object = None
classType = 'warObject.%s' % objectName
for i in range(0, len(warObject.__dict__)):
self.LogInfo('Processing', items[i])
if len(items[i][0]) > 1:
if items[i][0][:2] == '__':
continue
if items[i][1].__guid__ == classType:
object = CreateInstance(classType, (self,))
break
if object is None:
raise RuntimeError('FunctionalObject not found %s' % classType)
setattr(self, objectName, object)
for objectName in self.__functionalobjects__:
object = getattr(self, objectName)
object.DoObjectWeakRefConnections()
self.state = SERVICE_RUNNING
uthread.new(self.CheckForStartOrEndOfWar)
开发者ID:Pluckyduck,项目名称:eve,代码行数:30,代码来源:war_cso.py
示例12: OnOrbitalStrikeTargets
def OnOrbitalStrikeTargets(self, targets):
self.targets = targets
for targetID, target in self.targets.iteritems():
target['targetID'] = targetID
sm.ScatterEvent('OnDistrictTargets', targets)
uthread.new(self._LoadTargetBalls)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:districtSvc.py
示例13: OnFKeyOverload
def OnFKeyOverload(self, sidx, gidx):
slot = self.slotsByOrder.get((gidx, sidx), None)
if slot and slot.sr.module and slot.sr.module.state == uiconst.UI_NORMAL:
if hasattr(slot.sr.module, 'ToggleOverload'):
uthread.new(slot.sr.module.ToggleOverload)
else:
uthread.new(eve.Message, 'Disabled')
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:slotsContainer.py
示例14: OnViewStateChanged
def OnViewStateChanged(self, oldState, newState):
if newState == 'charactercreation':
uthread.new(self.GatherStats, self.lastClientState, session.locationid)
if oldState in ('station', 'hangar'):
self.lastClientState = 'charCustomization'
else:
self.lastClientState = newState
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:clientStatsSvc.py
示例15: SwitchBloodline
def SwitchBloodline(self, newBloodlineID, *args):
uicore.layer.charactercreation.FadeToBlack(why=localization.GetByLabel('UI/Common/Loading'))
sm.GetService('character').StopEditing()
self.bloodlineID = newBloodlineID
self.sr.bloodlineCont.Flush()
self.RearrangeInfo(self.bloodlineID, 'bloodlineID', self.currentBloodlineInfo)
self.CreateBloodlineHex()
self.SelectHex(self.bloodlineConts.get(self.bloodlineID), [])
info = uicore.layer.charactercreation.GetInfo()
sm.GetService('character').RemoveCharacter(info.charID)
uicore.layer.charactercreation.AddCharacter(info.charID, newBloodlineID, info.genderID)
uicore.layer.charactercreation.SelectBloodline(self.bloodlineID, check=0)
doll = sm.GetService('character').GetSingleCharactersDoll(info.charID)
while doll.busyUpdating:
blue.synchro.Yield()
step = uicore.layer.charactercreation.sr.step
if hasattr(step, 'GoToAssetMode'):
uthread.new(step.GoToAssetMode, 0, 1)
if step.sr.tattooMenu and not step.sr.tattooMenu.destroyed:
step.sr.tattooMenu.Close()
else:
uicore.layer.charactercreation.StartEditMode(mode='sculpt', resetAll=True)
if hasattr(step, 'LoadFaceMode'):
uthread.new(step.LoadFaceMode)
uicore.layer.charactercreation.FadeFromBlack()
开发者ID:Pluckyduck,项目名称:eve,代码行数:26,代码来源:hexes.py
示例16: Select
def Select(self):
self.selectBlock.color.SetRGB(*self.SELECT_FILL_COLOR)
if self.loadingIcon:
self.loadingIcon.state = uiconst.UI_DISABLED
self.icon.state = uiconst.UI_HIDDEN
uthread.new(self.loadingIcon.StartRotationCycle, 1.0, 4000.0)
self.selected = True
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:resourceController.py
示例17: _TryExecuteHandler
def _TryExecuteHandler(self, eventID, object, eventArgs = None, param = None):
functionName = self.EVENTMAP.get(eventID, None)
if functionName is None:
raise NotImplementedError
itemCapturingMouse = self.GetMouseCapture()
if itemCapturingMouse:
object = itemCapturingMouse
retObject = None
handlerArgs, handler = self.FindEventHandler(object, functionName)
if handler:
retObject = object
if eventArgs:
args = handlerArgs + eventArgs
else:
args = handlerArgs
if eventID in self.UTHREADEDEVENTS:
uthread.new(handler, *args)
else:
try:
handler(*args)
except:
log.LogException()
raise
self.CheckCallbacks(retObject, eventID, param)
return retObject
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:26,代码来源:uilib.py
示例18: DoDestinyUpdate
def DoDestinyUpdate(self, state, waitForBubble, dogmaMessages = [], doDump = True):
self.LogInfo('DoDestinyUpdate call for tick', state[0][0], 'containing', len(state), 'updates. waitForBubble=', waitForBubble)
if self.__bp is None:
raise RuntimeError('No ballpark for update')
if dogmaMessages:
self.LogInfo('OnMultiEvent has', len(dogmaMessages), 'messages')
sm.ScatterEvent('OnMultiEvent', dogmaMessages)
expandedStates = []
for action in state:
if action[1][0] == 'PackagedAction':
try:
unpackagedActions = blue.marshal.Load(action[1][1])
expandedStates.extend(unpackagedActions)
except:
log.LogException('Exception whilst expanding a PackagedAction')
sys.exc_clear()
else:
expandedStates.append(action)
state = expandedStates
timestamps = set()
for action in state:
timestamps.add(action[0])
if len(timestamps) > 1:
self.LogError('Found update batch with', len(state), 'items and', len(timestamps), 'timestamps')
for action in state:
self.LogError('Action:', action)
sm.GetService('clientStatsSvc').OnFatalDesync()
if not self.__bp.hideDesyncSymptoms:
uthread.new(eve.Message, 'CustomInfo', {'info': 'Desync mismatched updates problem occurred'})
self.__bp.FlushState(state, waitForBubble, doDump)
开发者ID:Pluckyduck,项目名称:eve,代码行数:34,代码来源:michelle.py
示例19: OnFleetLeave_Local
def OnFleetLeave_Local(self, memberInfo):
if self.destroyed:
return
myID = util.GetAttrs(self, 'sr', 'node', 'charID')
charID = memberInfo.charID
if myID is not None and charID == myID or charID == session.charid:
uthread.new(self.SetRelationship, self.sr.node)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:userentry.py
示例20: DoCollision
def DoCollision(self, targetId, fx, fy, fz, fake = False):
if self.collided:
return
self.collided = True
if self.model is None:
return
uthread.new(self._DoCollision)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:missile.py
注:本文中的uthread.new函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论