def elementId(self): """returns the SVG element id of the tile""" if not self.showShadows: return QString("TILE_2") lightSourceIndex = LIGHTSOURCES.index( self.tile.board.rotatedLightSource()) return QString("TILE_%1").arg(lightSourceIndex % 4 + 1)
def __changeAngle2(self, dummyResult): """now that no animation is running, really change""" if self.game: # might be finished meanwhile with Animated(False): wall = self.game.wall oldIdx = LIGHTSOURCES.index(wall.lightSource) # pylint: disable=E1101 newLightSource = LIGHTSOURCES[(oldIdx + 1) % 4] wall.lightSource = newLightSource self.selectorBoard.lightSource = newLightSource self.discardBoard.lightSource = newLightSource self.adjustView() scoringDialog = self.actionScoring.data().toPyObject() if isinstance(scoringDialog, ScoringDialog): scoringDialog.computeScores() self.centralScene.placeFocusRect()
def newLightSource(self): """next value""" oldIdx = LIGHTSOURCES.index(self.game.wall.lightSource) return LIGHTSOURCES[(oldIdx + 1) % 4]
def shadowOffsets(self, lightSource, rotation): """real offset of the shadow on the screen""" if not Internal.Preferences.showShadows: return (0, 0) lightSourceIndex = LIGHTSOURCES.index(lightSource) return self.__shadowOffsets[lightSourceIndex][rotation // 90]
def elementId(self): """returns the SVG element id of the tile""" if not self.showShadows: return QString("TILE_2") lightSourceIndex = LIGHTSOURCES.index(self.tile.board.rotatedLightSource()) return QString("TILE_%1").arg(lightSourceIndex%4+1)
def shadowOffsets(self, lightSource, rotation): """real offset of the shadow on the screen""" if not Preferences.showShadows: return (0, 0) lightSourceIndex = LIGHTSOURCES.index(lightSource) return self.__shadowOffsets[lightSourceIndex][rotation//90]
def rotatedLightSource(self): """the light source we need for the original tile before it is rotated""" lightSourceIndex = LIGHTSOURCES.index(self.lightSource) lightSourceIndex = (lightSourceIndex+self.sceneRotation() // 90)%4 return LIGHTSOURCES[lightSourceIndex]
def __elementId(self): """returns the SVG element id of the tile""" if not Internal.Preferences.showShadows: return "TILE_2" lightSourceIndex = LIGHTSOURCES.index(self.board.rotatedLightSource()) return "TILE_{}".format(lightSourceIndex % 4 + 1)
def __elementId(self): """returns the SVG element id of the tile""" if not Internal.Preferences.showShadows: return QString("TILE_2") lightSourceIndex = LIGHTSOURCES.index(self.board.rotatedLightSource()) return QString("TILE_{}".format(lightSourceIndex % 4 + 1))