|
|
@@ -11,14 +11,16 @@ from direct.tkwidgets.SceneGraphExplorer import *
|
|
|
from tkMessageBox import showinfo
|
|
|
from tkFileDialog import *
|
|
|
from Tkinter import *
|
|
|
-from whrandom import *
|
|
|
+#from whrandom import *
|
|
|
+from random import *
|
|
|
from direct.tkwidgets import Floater
|
|
|
from direct.tkwidgets import VectorWidgets
|
|
|
import string
|
|
|
import os
|
|
|
import getopt
|
|
|
import sys
|
|
|
-import whrandom
|
|
|
+#import whrandom
|
|
|
+import random
|
|
|
import types
|
|
|
from direct.task import Task
|
|
|
import Pmw
|
|
|
@@ -1603,7 +1605,7 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
print "createDoor %s" % type
|
|
|
if not (self.getCurrent('door_double_texture')):
|
|
|
doorStyles = self.styleManager.attributeDictionary['door_double_texture'].getList()[1:]
|
|
|
- defaultDoorStyle = whrandom.choice(doorStyles)
|
|
|
+ defaultDoorStyle = random.choice(doorStyles)
|
|
|
self.setCurrent('door_double_texture', defaultDoorStyle)
|
|
|
newDNADoor.setCode(self.getCurrent('door_double_texture'))
|
|
|
print "doorcolor = %s" % self.getCurrent('door_color')
|
|
|
@@ -1612,7 +1614,7 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
newDNADoor = DNAFlatDoor('door')
|
|
|
if not (self.getCurrent('door_single_texture')):
|
|
|
doorStyles = self.styleManager.attributeDictionary['door_single_texture'].getList()[1:]
|
|
|
- defaultDoorStyle = whrandom.choice(doorStyles)
|
|
|
+ defaultDoorStyle = random.choice(doorStyles)
|
|
|
self.setCurrent('door_single_texture', defaultDoorStyle)
|
|
|
newDNADoor.setCode(self.getCurrent('door_single_texture'))
|
|
|
newDNADoor.setColor(self.getCurrent('door_color'))
|
|
|
@@ -3599,7 +3601,7 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
colorList = self.getAttribute('door_color').getList()
|
|
|
colorList = colorList[1:3] + colorList[4:len(colorList)]
|
|
|
# Set a random door color
|
|
|
- doorColor = whrandom.choice(colorList)
|
|
|
+ doorColor = random.choice(colorList)
|
|
|
self.setCurrent('door_color', doorColor)
|
|
|
self.addLandmark(oldDNANode.getCode(), oldDNANode.getBuildingType())
|
|
|
bldg = self.lastNodePath
|
|
|
@@ -3703,13 +3705,13 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
elif curveType == 'trees':
|
|
|
curve.getPoint(currT, currPoint)
|
|
|
# trees are spaced anywhere from 40-80 ft apart
|
|
|
- treeWidth = whrandom.randint(40, 80)
|
|
|
+ treeWidth = random.randint(40, 80)
|
|
|
curGroupWidth += treeWidth
|
|
|
# Adjust grid orientation based upon next point along curve
|
|
|
currT, currPoint = self.findBldgEndPoint(treeWidth, curve, currT, currPoint, rd = 0)
|
|
|
|
|
|
# Add some trees
|
|
|
- tree = whrandom.choice(["prop_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_tree_small_ul",
|
|
|
"prop_tree_small_ur",
|
|
|
"prop_tree_large_ur",
|
|
|
"prop_tree_large_ul"])
|
|
|
@@ -3717,7 +3719,7 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
#use snow if necessaryy
|
|
|
|
|
|
if (useSnowTree):
|
|
|
- tree = whrandom.choice(["prop_snow_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_snow_tree_small_ul",
|
|
|
"prop_snow_tree_small_ur",
|
|
|
"prop_snow_tree_large_ur",
|
|
|
"prop_snow_tree_large_ul"])
|
|
|
@@ -3763,14 +3765,14 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
#add a prop_tree to force it to be shown
|
|
|
curve.getPoint(currT, currPoint)
|
|
|
#trees are spaced anywhere from 40-80 ft apart
|
|
|
- #treeWidth = whrandom.randint(40, 80)
|
|
|
+ #treeWidth = random.randint(40, 80)
|
|
|
treeWidth = barricadeWidth
|
|
|
curGroupWidth += treeWidth
|
|
|
# Adjust grid orientation based upon next point along curve
|
|
|
currT, currPoint = self.findBldgEndPoint(treeWidth, curve, currT, currPoint, rd = 0)
|
|
|
|
|
|
# Add some trees
|
|
|
- tree = whrandom.choice(["prop_snow_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_snow_tree_small_ul",
|
|
|
"prop_snow_tree_small_ur",
|
|
|
"prop_snow_tree_large_ur",
|
|
|
"prop_snow_tree_large_ul"])
|
|
|
@@ -3873,20 +3875,20 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
elif curveType == 'trees':
|
|
|
curve.getPoint(currT, currPoint)
|
|
|
# trees are spaced anywhere from 40-80 ft apart
|
|
|
- treeWidth = whrandom.randint(40, 80)
|
|
|
+ treeWidth = random.randint(40, 80)
|
|
|
curGroupWidth += treeWidth
|
|
|
# Adjust grid orientation based upon next point along curve
|
|
|
currT, currPoint = self.findBldgEndPoint(treeWidth, curve, currT, currPoint, rd = 0)
|
|
|
|
|
|
# Add some trees
|
|
|
- tree = whrandom.choice(["prop_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_tree_small_ul",
|
|
|
"prop_tree_small_ur",
|
|
|
"prop_tree_large_ur",
|
|
|
"prop_tree_large_ul"])
|
|
|
|
|
|
#use snow tree if necessary
|
|
|
if (useSnowTree):
|
|
|
- tree = whrandom.choice(["prop_snow_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_snow_tree_small_ul",
|
|
|
"prop_snow_tree_small_ur",
|
|
|
"prop_snow_tree_large_ur",
|
|
|
"prop_snow_tree_large_ul"])
|
|
|
@@ -3932,14 +3934,14 @@ class LevelEditor(NodePath, DirectObject):
|
|
|
#add a prop_tree to force it to be shown
|
|
|
curve.getPoint(currT, currPoint)
|
|
|
#trees are spaced anywhere from 40-80 ft apart
|
|
|
- #treeWidth = whrandom.randint(40, 80)
|
|
|
+ #treeWidth = random.randint(40, 80)
|
|
|
treeWidth = barricadeWidth
|
|
|
curGroupWidth += treeWidth
|
|
|
# Adjust grid orientation based upon next point along curve
|
|
|
currT, currPoint = self.findBldgEndPoint(treeWidth, curve, currT, currPoint, rd = 0)
|
|
|
|
|
|
# Add some trees
|
|
|
- tree = whrandom.choice(["prop_snow_tree_small_ul",
|
|
|
+ tree = random.choice(["prop_snow_tree_small_ul",
|
|
|
"prop_snow_tree_small_ur",
|
|
|
"prop_snow_tree_large_ur",
|
|
|
"prop_snow_tree_large_ul"])
|