Changing the time of day also changes the sky color.

This commit is contained in:
David Vierra 2015-09-14 18:01:25 -10:00
parent b236de9611
commit 0d49345f29
2 changed files with 9 additions and 2 deletions

View File

@ -1187,6 +1187,8 @@ class EditorTab(QtGui.QWidget):
def setDayTime(self, value): def setDayTime(self, value):
if self.editorSession.textureAtlas: if self.editorSession.textureAtlas:
self.editorSession.textureAtlas.dayTime = value self.editorSession.textureAtlas.dayTime = value
for view in self.views:
view.setDayTime(value)
self.currentView().update() self.currentView().update()
def setGamma(self, value): def setGamma(self, value):

View File

@ -135,6 +135,7 @@ class WorldView(QGLWidget):
self.geometryCache = geometryCache self.geometryCache = geometryCache
self.matrixNode = None self.matrixNode = None
self.skyNode = None
self.overlayNode = scenenode.Node() self.overlayNode = scenenode.Node()
self.sceneGraph = None self.sceneGraph = None
@ -225,7 +226,7 @@ class WorldView(QGLWidget):
self.worldScene.setVisibleLayers(self.layerToggleGroup.getVisibleLayers()) self.worldScene.setVisibleLayers(self.layerToggleGroup.getVisibleLayers())
clearNode = ClearNode() clearNode = ClearNode()
skyNode = sky.SkyNode() self.skyNode = sky.SkyNode()
self.loadableChunksNode = loadablechunks.LoadableChunksNode(self.dimension) self.loadableChunksNode = loadablechunks.LoadableChunksNode(self.dimension)
self.matrixNode = MatrixNode() self.matrixNode = MatrixNode()
@ -236,7 +237,7 @@ class WorldView(QGLWidget):
self.matrixNode.addChild(self.overlayNode) self.matrixNode.addChild(self.overlayNode)
sceneGraph.addChild(clearNode) sceneGraph.addChild(clearNode)
sceneGraph.addChild(skyNode) sceneGraph.addChild(self.skyNode)
sceneGraph.addChild(self.matrixNode) sceneGraph.addChild(self.matrixNode)
sceneGraph.addChild(self.compassOrthoNode) sceneGraph.addChild(self.compassOrthoNode)
if self.cursorNode: if self.cursorNode:
@ -661,6 +662,10 @@ class WorldView(QGLWidget):
self.worldScene.setLayerVisible(layerName, visible) self.worldScene.setLayerVisible(layerName, visible)
self.resetLoadOrder() self.resetLoadOrder()
def setDayTime(self, value):
if self.skyNode:
self.skyNode.setDayTime(value)
def iterateChunks(x, z, radius): def iterateChunks(x, z, radius):
""" """
Yields a list of chunk positions starting from the center and going outward in a square spiral pattern. Yields a list of chunk positions starting from the center and going outward in a square spiral pattern.